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

Name

Description

allocator

allocator (or pool) that allocated p

p

address of the memory block to manage, or null

nbytes

size in bytes of the block at p

alignment

alignment used when p was allocated

Created with MrDocs