[#BloombergLP-bslma-DeallocatorProctor] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslma.adoc[bslma]::DeallocatorProctor :relfileprefix: ../../ :mrdocs: This class implements a proctor that, unless its `release` method has previously been invoked, automatically deallocates a block of managed memory upon destruction by invoking the `deallocate` method of an allocator (or pool) of parameterized `ALLOCATOR` type supplied to it at construction. The managed memory must have been provided by this allocator (or pool), which must remain valid throughout the lifetime of the proctor object. == Synopsis Declared in `<bslma_deallocatorproctor.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class ALLOCATOR> class DeallocatorProctor; ---- == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslma/DeallocatorProctor/2constructor.adoc[`DeallocatorProctor`] [.small]#[constructor]# | 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. | xref:BloombergLP/bslma/DeallocatorProctor/2destructor.adoc[`~DeallocatorProctor`] [.small]#[destructor]# | Destroy this deallocator proctor, and deallocate the block of memory it manages (if any) by invoking the `deallocate` method of the allocator (or pool) that was supplied at construction of this proctor. If no memory is currently being managed, this method has no effect. | xref:BloombergLP/bslma/DeallocatorProctor/release.adoc[`release`] | Release from management the block of memory currently managed by this proctor. If no memory is currently being managed, this method has no effect. | xref:BloombergLP/bslma/DeallocatorProctor/reset.adoc[`reset`] | Set the specified `memory` as the block of memory to be managed by this proctor. The behavior is undefined unless `memory` is non‐zero and was allocated by the allocator (or pool) supplied at construction. Note that this method releases any previously‐managed memory from management (without deallocating it), and so may be invoked with or without having called `release` when reusing this object. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#