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.
Synopsis
Declared in <bdlma_sequentialallocator.h>
class SequentialAllocator
: public ManagedAllocator
Base Classes
Name |
Description |
This protocol class extends |
Type Aliases
Name |
Description |
Alias for an unsigned integral type capable of representing the number of bytes in this platform's virtual address space. |
Member Functions
Name |
Description |
|
Constructors |
|
Destroy this sequential allocator. All memory allocated from this allocator is released. |
|
|
Return the address of a contiguous block of memory of at least the specified |
|
This method has no effect on the memory block at the specified |
|
|
|
|
|
|
Release all memory allocated through this allocator and return to the underlying allocator all memory. The allocator 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 invokation of |
Reserve sufficient memory to satisfy allocation requests for at least the specified |
|
|
Release all memory allocated through this allocator and return to the underlying allocator only memory that was allocated outside of the typical internal buffer growth of this allocator (i.e., large blocks). All retained memory will be used to satisfy subsequent allocations. The effect of subsequently ‐ to this invokation of |
Reduce the amount of memory allocated at the specified |
Static Member Functions
Name |
Description |
Throw |
Protected Member Functions
Name |
Description |
|
Return a newly allocated block of memory of (at least) the specified positive |
|
Return the memory block at the specified |
|
Return |
Created with MrDocs