BloombergLP::bslma::SequentialAllocator

This class implements the ManagedAllocator protocol to provide a fast allocator of arbitrarily-sized blocks of memory.

Synopsis

Declared in <bslma_sequentialallocator.h>

class SequentialAllocator
    : public 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

NameDescription
ManagedAllocatorProtocol for allocators that support releasing all allocated memory.

Type Aliases

NameDescription
size_type Alias for an unsigned integral type capable of representing the number of bytes in this platform's virtual address space.

Member Functions

NameDescription
SequentialAllocator [constructor]Constructors
~SequentialAllocator [destructor] [virtual]Destroy this sequential allocator and release all associated memory.
operator=
allocate allocate overloads
allocateAndExpand allocateAndExpand overloads
deallocate This method has no effect for this allocator.
deleteObject deleteObject overloads
deleteObjectRaw deleteObjectRaw overloads
expand expand overloads
is_equal
release [virtual]Release all memory currently allocated through this allocator.
reserveCapacity [virtual]Reserve memory for at least the specified numBytes of allocations.
truncate Reduce the amount of memory allocated at the specified address.

Static Member Functions

NameDescription
throwBadAlloc Throw std::bad_alloc or abort the program.

Protected Member Functions

NameDescription
do_allocate [virtual]Return a newly allocated block of at least bytes with alignment.
do_deallocate [virtual]Return the memory block at p having bytes and alignment.
do_is_equal [virtual]Return whether this allocator can exchange memory with other.