BloombergLP::bdlma::ConcurrentAllocatorAdapter

Thread-enabled adapter that synchronizes access to a decorated allocator.

Synopsis

Declared in <bdlma_concurrentallocatoradapter.h>

class ConcurrentAllocatorAdapter
    : public bslma::Allocator

Description

This class defines an implementation of the bslma::Allocator protocol that "decorates" (wraps) a concrete bslma::Allocator to ensure thread-safe access to the decorated allocator.

Base Classes

NameDescription
bslma::AllocatorPure abstract protocol for clients and suppliers of raw 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
ConcurrentAllocatorAdapter [constructor]Create a thread-enabled allocator adapter for the specified allocator.
~ConcurrentAllocatorAdapter [destructor] [virtual]Destroy this thread-enabled allocator adapter.
operator=
allocate allocate overloads
deallocate Return the memory block at the specified address to this allocator.
deleteObject deleteObject overloads
deleteObjectRaw deleteObjectRaw overloads
is_equal

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.