|
BDE 4.39.x Production Release
|
#include <bdlma_heapbypassallocator.h>
This class allows the caller to allocate memory directly from virtual memory, without going through the heap like malloc or new would.
Public Member Functions | |
| HeapBypassAllocator () | |
| HeapBypassAllocator (size_type replenishHint) | |
| ~HeapBypassAllocator () BSLS_KEYWORD_OVERRIDE | |
| void * | allocate (bsls::Types::size_type size) BSLS_KEYWORD_OVERRIDE |
| void | deallocate (void *) BSLS_KEYWORD_OVERRIDE |
Public Member Functions inherited from bslma::Allocator | |
| ~Allocator () BSLS_KEYWORD_OVERRIDE | |
| template<class TYPE > | |
| void | deleteObject (const TYPE *object) |
| template<class TYPE > | |
| void | deleteObjectRaw (const TYPE *object) |
| void | deleteObject (bsl::nullptr_t) |
| void | deleteObjectRaw (bsl::nullptr_t) |
Public Member Functions inherited from bsl::memory_resource | |
| memory_resource () BSLS_KEYWORD_DEFAULT | |
| memory_resource (const memory_resource &) BSLS_KEYWORD_DEFAULT | |
| virtual | ~memory_resource () |
| memory_resource & | operator= (const memory_resource &) BSLS_KEYWORD_DEFAULT |
| BSLA_NODISCARD void * | allocate (size_t bytes, size_t alignment=k_MAX_ALIGN) |
| void | deallocate (void *p, size_t bytes, size_t alignment=k_MAX_ALIGN) |
| bool | is_equal (const memory_resource &other) const BSLS_KEYWORD_NOEXCEPT |
Additional Inherited Members | |
Public Types inherited from bslma::Allocator | |
| typedef std::size_t | size_type |
Static Public Member Functions inherited from bslma::Allocator | |
| static void | throwBadAlloc () |
Protected Member Functions inherited from bslma::Allocator | |
| void * | do_allocate (std::size_t bytes, std::size_t alignment) BSLS_KEYWORD_OVERRIDE |
| void | do_deallocate (void *p, std::size_t bytes, std::size_t alignment) BSLS_KEYWORD_OVERRIDE |
| bool | do_is_equal (const memory_resource &other) const BSLS_KEYWORD_NOEXCEPT BSLS_KEYWORD_OVERRIDE |
| bdlma::HeapBypassAllocator::HeapBypassAllocator | ( | ) |
Create an empty allocator object. Optionally specify replenishHint as the minimum number of bytes to allocate at a time when the allocator's memory needs to grow. In a multi-threaded scenario, the programmer should ensure that replenishHint is large enough so that multiple threads will rarely need to replenish at the same time in order to minimize contention.
|
explicit |
| bdlma::HeapBypassAllocator::~HeapBypassAllocator | ( | ) |
Destroy this object, releasing all managed buffers of memory that it has allocated.
|
inlinevirtual |
Allocate a buffer of memory having the specified size (in bytes), and alignment defined by bsls::AlignmentUtil::BSLS_MAX_ALIGNMENT, from virtual memory. If size is 0, return a null pointer with no other effect. If this allocator cannot return the requested number of bytes, then it will throw a std::bad_alloc exception in an exception-enabled build, or else will abort the program in a non- exception build.
0 <= size. Implements bslma::Allocator.
|
inlinevirtual |
This method has no effect for this heap bypass allocator.
Implements bslma::Allocator.