[#BloombergLP-bdlma-LocalSequentialAllocator] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlma.adoc[bdlma]::LocalSequentialAllocator :relfileprefix: ../../ :mrdocs: Fast allocator that dispenses heterogeneous blocks from a local buffer. == Synopsis Declared in `<bdlma_localsequentialallocator.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<int t_SIZE> class LocalSequentialAllocator : public xref:BloombergLP/bdlma/BufferedSequentialAllocator.adoc[BufferedSequentialAllocator] ---- == 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 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. == Base Classes [cols="1,4"] |=== | Name| Description | `xref:BloombergLP/bdlma/BufferedSequentialAllocator.adoc[BufferedSequentialAllocator]` | Fast allocator that dispenses heterogeneous blocks from an external buffer. |=== == Type Aliases [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslma/Allocator/size_type.adoc[`size_type`] | Alias for an unsigned integral type capable of representing the number of bytes in this platform's virtual address space. |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdlma/LocalSequentialAllocator/2constructor.adoc[`LocalSequentialAllocator`] [.small]#[constructor]# | Create a local sequential allocator using an internal buffer of `t_SIZE` bytes. | xref:BloombergLP/bslma/Allocator/operator_assign.adoc[`operator=`] | | xref:BloombergLP/bdlma/BufferedSequentialAllocator/allocate-0f.adoc[`allocate`] | Return a block of memory of the specified `size` (in bytes). | xref:BloombergLP/bdlma/BufferedSequentialAllocator/allocator.adoc[`allocator`] | Return the allocator passed at construction. | xref:BloombergLP/bdlma/BufferedSequentialAllocator/deallocate-0c3.adoc[`deallocate`] | This method has no effect on the specified memory block. | xref:BloombergLP/bslma/Allocator/deleteObject-09.adoc[`deleteObject`] | `deleteObject` overloads | xref:BloombergLP/bslma/Allocator/deleteObjectRaw-06f.adoc[`deleteObjectRaw`] | `deleteObjectRaw` overloads | xref:BloombergLP/bslma/Allocator/is_equal.adoc[`is_equal`] | | xref:BloombergLP/bdlma/BufferedSequentialAllocator/release.adoc[`release`] [.small]#[virtual]# | Release all memory allocated through this allocator except the external buffer supplied at construction. | xref:BloombergLP/bdlma/BufferedSequentialAllocator/rewind.adoc[`rewind`] [.small]#[virtual]# | Release allocated memory while retaining this allocator's typical internal buffers. |=== == Static Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslma/Allocator/throwBadAlloc.adoc[`throwBadAlloc`] | Throw `std::bad_alloc` or abort the program. |=== == Protected Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslma/Allocator/do_allocate.adoc[`do_allocate`] [.small]#[virtual]# | Return a newly allocated block of at least `bytes` with `alignment`. | xref:BloombergLP/bslma/Allocator/do_deallocate.adoc[`do_deallocate`] [.small]#[virtual]# | Return the memory block at `p` having `bytes` and `alignment`. | xref:BloombergLP/bslma/Allocator/do_is_equal.adoc[`do_is_equal`] [.small]#[virtual]# | Return whether this allocator can exchange memory with `other`. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#