BloombergLP::bslma::DeallocateBytesProctor::DeallocateBytesProctor

Create a proctor to manage a memory block from the specified allocator.

Synopsis

Declared in <bslma_deallocatebytesproctor.h>

DeallocateBytesProctor(
    ALLOCATOR const& allocator,
    PtrType p,
    std::size_t nbytes,
    std::size_t alignment = k_MAX_ALIGNMENT);

Description

Create a proctor to manage the specified nbytes bytes at the specified p address, which have been allocated from the specified allocator. Optionally specify the alignment used to allocate the bytes. If p is null, then the created proctor is disengaged (manages no memory). The behavior is undefined unless p is null or was allocated from allocator with a size of nbytes and alignment of alignment.

Parameters

NameDescription
allocatorallocator (or pool) that allocated p
paddress of the memory block to manage, or null
nbytessize in bytes of the block at p
alignmentalignment used when p was allocated