[#BloombergLP-bslma-DeallocateBytesProctor]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslma.adoc[bslma]::DeallocateBytesProctor
:relfileprefix: ../../
:mrdocs:

This class implements a proctor that, unless its `release` method has previously been invoked, automatically deallocates a managed block of memory upon destruction by invoking the `deallocate` method of an allocator (or pool) of parameterized `ALLOCATOR` type supplied to it at construction&period; The managed memory block must have been provided by the supplied allocator (or pool)&semi; the allocator (or pool) must remain valid throughout the lifetime of the proctor object&period; If `ALLOCATOR` is a non&hyphen;pointer type, it is assumed to be STL compatible&semi; otherwise it is assumed have the same deallocation interface as `bslma&colon;&colon;Allocator`&period;

== Synopsis

Declared in `&lt;bslma&lowbar;deallocatebytesproctor&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class ALLOCATOR&gt;
class DeallocateBytesProctor;
----

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslma/DeallocateBytesProctor/2constructor-01.adoc[`DeallocateBytesProctor`]         [.small]#[constructor]#
| Constructors
| xref:BloombergLP/bslma/DeallocateBytesProctor/2destructor.adoc[`&#126;DeallocateBytesProctor`] [.small]#[destructor]#
| Deallocate the managed memory, if any, without invoking any other destructors&period;
| xref:BloombergLP/bslma/DeallocateBytesProctor/ptr.adoc[`ptr`] 
| Return the address of the currently managed memory block, if engaged&semi; otherwise return a null pointer&period;
| xref:BloombergLP/bslma/DeallocateBytesProctor/release.adoc[`release`] 
| Disengage this allocator and return a pointer to the formerly managed memory block&period;
| xref:BloombergLP/bslma/DeallocateBytesProctor/reset.adoc[`reset`] 
| Release the managed memory and reset this proctor to manage the specified `nbytes` bytes at the specified `p` address&period; Optionally specify the `alignment` used to allocate `p`&period; If `p` is null, then the proctor is disengaged (manages no memory)&period; The behavior is undefined unless `p` is null or was allocated with a size of `nbytes` and alignment of `alignment` from the same allocator used to construct this proctor&period; Note that the previously managed block is not deallocated&period;
|===



[.small]#Created with https://www.mrdocs.com[MrDocs]#
