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.
Synopsis
Declared in <bdlma_sequentialpool.h>
class SequentialPool;
Member Functions
Name |
Description |
|
Constructors |
|
Destroy this sequential pool. All memory allocated by this pool is released. |
Return the address of a contiguous block of memory of the specified |
|
Return the address of a contiguous block of memory of at least the specified |
|
Return the allocator used by this object to allocate memory. Note that this allocator can not be used to deallocate memory allocated through this pool. |
|
Destroy the specified |
|
Destroy the specified |
|
Release all memory allocated through this pool and return to the underlying allocator all memory. The pool is reset to its default‐constructed state, retaining the alignment and growth strategies, and the initial and maximum buffer sizes in effect following construction. The effect of subsequently ‐ to this invocation of |
|
Reserve sufficient memory to satisfy allocation requests for at least the specified |
|
Release all memory allocated through this pool and return to the underlying allocator only memory that was allocated outside of the typical internal buffer growth of this pool (i.e., large blocks). All retained memory will be used to satisfy subsequent allocations. The effect of subsequently ‐ to this invocation of |
|
Reduce the amount of memory allocated at the specified |
Created with MrDocs