BloombergLP::bdlma

Namespace for managed allocator components.

Types

NameDescription
AlignedAllocator This protocol provides a pure abstract interface and contract for clients and suppliers of raw aligned memory. If the requested memory cannot be returned, the contract requires that an std::bad_alloc exception be thrown.
AligningAllocator This class provides a mechanism that serves as a wrapper around another allocator, passed at construction. The mechanism guarantees that all allocations passed to the underlying allocator will be aligned by the alignment specified at construction.
AutoReleaser This class implements a proctor that invokes the release method of its managed allocator or pool at destruction unless the proctor's release method is invoked.
BlockList This class implements a low-level memory manager that allocates and manages a sequence of memory blocks -- each potentially of a different size as specified during the invocation of the allocate method. Allocated blocks may be efficiently deallocated individually, i.e., potentially in constant time depending on the supplied allocator. The release method deallocates the entire sequence of memory blocks, as does the destructor.
BufferImpUtil This struct provides a namespace for a suite of pure procedures for allocating memory from a buffer.
BufferManager This class implements a buffer manager that dispenses heterogeneous blocks of memory (of varying, user-specified sizes) from an external buffer whose address and size are optionally supplied at construction. If an allocation request exceeds the remaining free memory space in the external buffer, the allocation request returns 0 if allocate is used, or results in undefined behavior if allocateRaw is used. Note that in no event will the buffer manager attempt to deallocate the external buffer.
BufferedSequentialAllocator This class implements the ManagedAllocator protocol to provide a fast allocator that dispenses heterogeneous blocks of memory (of varying, user-specified sizes) from an external buffer whose address and size (in bytes) are supplied at construction. If an allocation request exceeds the remaining free memory space in the external buffer, memory will be supplied by an (optional) allocator also supplied at construction; if no allocator is supplied, the currently installed default allocator is used. This class is exception neutral: If memory cannot be allocated, the behavior is defined by the (optional) allocator supplied at construction. Note that in no case will the buffered sequential allocator attempt to deallocate the external buffer.
BufferedSequentialPool Fast memory pool dispensing blocks from an external buffer.
ConcurrentAllocatorAdapter This class defines an implementation of the bslma::Allocator protocol that "decorates" (wraps) a concrete bslma::Allocator to ensure thread-safe access to the decorated allocator.
ConcurrentFixedPool This class implements a memory pool that allocates and manages up to a fixed number of memory blocks of some uniform size, with both the limit on the number of blocks and the block size specified at construction.
ConcurrentFixedPool_Node The component-private struct provides a header for blocks that are allocated from ConcurrentFixedPool objects.
ConcurrentMultipool This class implements a memory manager that maintains a configurable number of bdlma::Pool objects, each dispensing memory blocks of a unique size. The Pool objects are placed in an array, with each successive pool managing memory blocks of size twice that of the previous pool. Each multipool allocation (deallocation) request allocates memory from (returns memory to) the internal pool having the smallest block size not less than the requested size, or, if no pool manages memory blocks of sufficient sized, from a separately managed list of memory blocks. Both the release method and the destructor of a bdema::Multipool release all memory currently allocated via the object.
ConcurrentMultipoolAllocator This class implements the bdlma::ManagedAllocator protocol to provide a thread-safe allocator that maintains a configurable number of Pool objects, each dispensing memory blocks of a unique size. The Pool objects are placed in an array, with each successive pool managing memory blocks of size twice that of the previous pool. Each multipool allocation (deallocation) request allocates memory from (returns memory to) the internal pool having the smallest block size not less than the requested size, or, if no pool manages memory blocks of sufficient sized, from a separately managed list of memory blocks. Both the release method and the destructor of a ConcurrentMultipoolAllocator release all memory currently allocated via the object.
ConcurrentPool This class implements a memory pool that allocates and manages memory blocks of some uniform size specified at construction. This memory pool maintains an internal linked list of free memory blocks, and dispenses one block for each allocate method invocation. When a memory block is deallocated, it is returned to the free list for potential reuse.
ConcurrentPoolAllocator This class implements the bslma::Allocator protocol to provide an allocator that manages pooled memory blocks of some uniform size, specified either at construction, or at the first invocation of the allocate method. This allocator maintains an internal linked list of free memory blocks, and dispenses one block for each allocate method invocation. When a memory block is deallocated, it is returned to the free list for potential reuse.
CountingAllocator This class defines a concrete "counting" allocator mechanism that implements the bslma::Allocator protocol, and provides instrumentation to track: (1) the number of bytes currently in use, and (2) the cumulative number of bytes that have ever been allocated. The accumulated statistics are based solely on the number of bytes requested (see allocate).
DefaultDeleter This class provides a default concrete implementation of the Deleter protocol. Instances of DefaultDeleter<TYPE> either use an allocator optionally supplied at construction, or the currently installed default allocator if an allocator is not provided.
Deleter Provide a protocol (or pure interface) for a thread-safe object deleter.
Factory This class provides a protocol (or pure interface) for a thread-safe object creator and deleter. It extends the Deleter protocol with the addition of a createObject method.
GuardingAllocator This class defines a concrete thread-safe "guarding" allocator mechanism that implements the bslma::Allocator protocol, and adjoins a read/write protected guard page to each block of memory returned by the allocate method. The guard page is placed immediately before or immediately following the block returned from allocate according to the GuardPageLocation enumerator value (optionally) supplied at construction. Note that, unlike many other allocators, an allocator cannot be (optionally) supplied at construction; instead, a system facility is used that allocates blocks of memory in multiples of the system page size. Also note that this allocator is intended for debugging purposes only.
HeapBypassAllocator This class allows the caller to allocate memory directly from virtual memory, without going through the heap like malloc or new would. Note that the only way to free any memory allocated with this object is to destroy the object, at which point all memory it has allocated is freed. Thread-safe.
InfrequentDeleteBlockList This class implements a low-level memory manager that allocates and manages a sequence of memory blocks -- each potentially of a different size as specified during the invocation of the allocate method. The release method deallocates the entire sequence of memory blocks, as does the destructor. Note that memory blocks cannot be deallocated individually.
LocalBufferedObject This class contains an object of type t_TYPE and a local sequential allocator with an arena size of t_BUFFER_SIZE, from which the t_TYPE object allocates memory, in a single object. The t_DISABLE_DESTRUCTION template parameter can be used to prevent this class from calling ~t_TYPE() in cases where it is known that t_TYPE manages no resources other than memory, since the memory will be adequately managed by the local sequential allocator.
LocalSequentialAllocator This class implements the ManagedAllocator protocol to provide a fast allocator that dispenses heterogeneous blocks of memory (of varying, user-specified sizes) from a local buffer whose capacity is the specified t_SIZE (in bytes). If an allocation request exceeds the remaining free memory space in the local buffer, memory will be supplied by an (optional) allocator supplied at construction; if no allocator is supplied, the currently installed default allocator is used. This class is exception neutral; if memory cannot be allocated, the behavior is defined by the (optional) allocator supplied at construction.
ManagedAllocator This protocol class extends bslma::Allocator for allocators with the ability to release all memory currently allocated through the protocol back to the memory supplier of the derived concrete allocator object.
MemoryBlockDescriptor This is an in-core value-semantic class describing the size and address of a block of memory. A null block descriptor is defined as a descriptor having an address and size of 0. The behavior is undefined for a descriptor whose address is 0, but whose size if not also 0.
Multipool This class implements a memory manager that maintains a configurable number of bdlma::Pool objects, each dispensing memory blocks of a unique size. The bdlma::Pool objects are placed in an array, with each successive pool managing memory blocks of size twice that of the previous pool. Each multipool allocation (deallocation) request allocates memory from (returns memory to) the internal pool having the smallest block size not less than the requested size, or, if no pool manages memory blocks of sufficient size, from a separately managed list of memory blocks. Both the release method and the destructor of a bdlma::Multipool release all memory currently allocated via the object.
MultipoolAllocator This class implements the bdlma::ManagedAllocator protocol to provide an allocator that maintains a configurable number of bdlma::Pool objects, each dispensing memory blocks of a unique size. The bdlma::Pool objects are placed in an array, with each successive pool managing memory blocks of size twice that of the previous pool. Each multipool allocation (deallocation) request allocates memory from (returns memory to) the internal pool having the smallest block size not less than the requested size, or, if no pool manages memory blocks of sufficient sized, from a separately managed list of memory blocks. Both the release method and the destructor of a bdlma::MultipoolAllocator release all memory currently allocated via the object.
Pool This class implements a memory pool that allocates and manages memory blocks of some uniform size specified at construction. This memory pool maintains an internal linked list of free memory blocks, and dispenses one block for each allocate method invocation. When a memory block is deallocated, it is returned to the free list for potential reuse.
SequentialAllocator This class implements the ManagedAllocator protocol to provide a fast allocator that dispenses heterogeneous blocks of memory (of varying, user-specified sizes) from a sequence of dynamically-allocated buffers. Memory for the internal buffers is supplied by an (optional) allocator supplied at construction; if no allocator is supplied, the currently installed default allocator is used. If an allocation exceeds the remaining free memory space in the current buffer, the allocator replenishes its internal buffer with new memory to satisfy the request. This class is exception neutral: If memory cannot be allocated, the behavior is defined by the (optional) allocator specified at construction.
SequentialPool This class implements a fast memory pool that efficiently dispenses heterogeneous blocks of memory (of varying, user-specified sizes) from a sequence of dynamically-allocated internal buffers. Memory for the internal buffers is supplied by an (optional) allocator supplied at construction; if no allocator is supplied, the currently installed default allocator is used. If an allocation exceeds the remaining free memory space in the current buffer, the pool replenishes its internal buffer with new memory to satisfy the request. This class is exception neutral: If memory cannot be allocated, the behavior is defined by the (optional) allocator specified at construction.

Functions

NameDescription
operator== Return true if the specified lhs and rhs memory block descriptors have the same value and false otherwise. Two descriptors have the same value if and only if they have the same address and size.
operator!= Return true if the specified lhs and rhs memory block descriptors do not have the same value and false otherwise. Two descriptors differ in value if they differ in either their address or size.