Create a deallocator proctor that conditionally manages memory.

Synopsis

Declared in <bslma_deallocatorproctor.h>

DeallocatorProctor(
    void* memory,
    ALLOCATOR* allocator);

Description

Create a deallocator proctor that conditionally manages the specified memory (if non‐zero), and that uses the specified allocator to deallocate the block of memory managed by this proctor (if not released ‐‐ see release) upon destruction. The behavior is undefined unless allocator is non‐zero and supplied memory. Note that allocator must remain valid throughout the lifetime of this proctor.

Parameters

Name

Description

memory

Memory block to manage, or 0 for none.

allocator

Allocator (or pool) used to deallocate managed memory.

Created with MrDocs