[#BloombergLP-bslma-SequentialAllocator] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslma.adoc[bslma]::SequentialAllocator :relfileprefix: ../../ :mrdocs: This class implements the `ManagedAllocator` protocol to provide a fast allocator of arbitrarily‐sized blocks of memory. == Synopsis Declared in `<bslma_sequentialallocator.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- class SequentialAllocator : public xref:BloombergLP/bslma/ManagedAllocator.adoc[ManagedAllocator] ---- == Description Both the `release` method and the destructor atomically delete all memory managed by this allocator; the `deallocate` method, however, has no effect for this class. == Base Classes [cols="1,4"] |=== | Name| Description | `xref:BloombergLP/bslma/ManagedAllocator.adoc[ManagedAllocator]` | Protocol for allocators that support releasing all allocated memory. |=== == 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/bslma/SequentialAllocator/2constructor-09.adoc[`SequentialAllocator`] [.small]#[constructor]# | Constructors | xref:BloombergLP/bslma/SequentialAllocator/2destructor.adoc[`~SequentialAllocator`] [.small]#[destructor]# [.small]#[virtual]# | Destroy this sequential allocator and release all associated memory. | xref:BloombergLP/bslma/Allocator/operator_assign.adoc[`operator=`] | | xref:BloombergLP/bslma/SequentialAllocator/allocate-06.adoc[`allocate`] | `allocate` overloads | xref:BloombergLP/bslma/SequentialAllocator/allocateAndExpand-0e.adoc[`allocateAndExpand`] | `allocateAndExpand` overloads | xref:BloombergLP/bslma/SequentialAllocator/deallocate-01.adoc[`deallocate`] | This method has no effect for this allocator. | xref:BloombergLP/bslma/Allocator/deleteObject-09.adoc[`deleteObject`] | `deleteObject` overloads | xref:BloombergLP/bslma/Allocator/deleteObjectRaw-06f.adoc[`deleteObjectRaw`] | `deleteObjectRaw` overloads | xref:BloombergLP/bslma/SequentialAllocator/expand-07.adoc[`expand`] | `expand` overloads | xref:BloombergLP/bslma/Allocator/is_equal.adoc[`is_equal`] | | xref:BloombergLP/bslma/SequentialAllocator/release.adoc[`release`] [.small]#[virtual]# | Release all memory currently allocated through this allocator. | xref:BloombergLP/bslma/SequentialAllocator/reserveCapacity.adoc[`reserveCapacity`] [.small]#[virtual]# | Reserve memory for at least the specified `numBytes` of allocations. | xref:BloombergLP/bslma/SequentialAllocator/truncate.adoc[`truncate`] | Reduce the amount of memory allocated at the specified `address`. |=== == 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]#