Fast allocator that dispenses heterogeneous blocks from dynamically allocated buffers.
Synopsis
Declared in <bdlma_sequentialallocator.h>
class SequentialAllocator
: public ManagedAllocator
Description
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.
Base Classes
Name |
Description |
Protocol for allocators that support releasing all allocated memory. |
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 a block of at least |
|
This method has no effect; memory is managed by this allocator. |
|
|
|
|
|
|
Release all memory allocated through this allocator. |
Reserve enough memory to satisfy at least |
|
|
Release allocated memory while retaining this allocator's typical internal buffers. |
Reduce the most recently allocated block at |
Static Member Functions
Name |
Description |
Throw |
Protected Member Functions
Name |
Description |
|
Return a newly allocated block of at least |
|
Return the memory block at |
|
Return whether this allocator can exchange memory with |
Created with MrDocs