Protocol for allocators that support releasing all allocated memory.

Synopsis

Declared in <bslma_managedallocator.h>

class ManagedAllocator
    : public Allocator

Description

This protocol class extends bslma::Allocator, providing 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

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

SequentialAllocator

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

Created with MrDocs