Protocol for allocators that support releasing all allocated memory.

Synopsis

Declared in <bdlma_managedallocator.h>

class ManagedAllocator
    : public bslma::Allocator

Description

This protocol class extends bslma::Allocator for allocators with the ability to release all memory currently allocated through the protocol back to the memory supplier of the derived concrete allocator object.

Base Classes

Name

Description

bslma::Allocator

Pure abstract protocol for clients and suppliers of raw memory.

Type Aliases

Name

Description

size_type

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

Member Functions

Name

Description

operator=

allocate

Return a newly allocated block of memory of at least size bytes.

deallocate

Return the memory block at address to this allocator.

deleteObject

deleteObject overloads

deleteObjectRaw

deleteObjectRaw overloads

is_equal

release [virtual]

Release all memory currently allocated through this allocator.

Static Member Functions

Name

Description

throwBadAlloc

Throw std::bad_alloc or abort the program.

Protected Member Functions

Name

Description

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.

Derived Classes

Name

Description

BufferedSequentialAllocator

Fast allocator that dispenses heterogeneous blocks from an external buffer.

ConcurrentMultipoolAllocator

Thread‐safe allocator managing pools of varying block sizes.

MultipoolAllocator

Allocator that manages pools of memory blocks of varying sizes.

SequentialAllocator

Fast allocator that dispenses heterogeneous blocks from dynamically allocated buffers.

StackTraceTestAllocator

This class defines a concrete "test" allocator mechanism that implements the bdlma::ManagedAllocator protocol.

Created with MrDocs