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

This class implements a range proctor that automatically deallocates managed memory blocks&period;

== Synopsis

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

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

== Description

This class implements a range proctor that, unless its `release` method has previously been invoked, automatically deallocates the contiguous sequence of managed memory blocks upon its own destruction by invoking the `deallocate` method of an allocator (or pool) of parameterized `ALLOCATOR` type supplied to it at construction&period; Each of the managed memory blocks must have been supplied by this allocator (or pool), which must remain valid throughout the lifetime of the range proctor&period; Note that when the length of this object is non&hyphen;zero, it must refer to a non&hyphen;null array of memory blocks&period;

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslma/AutoDeallocator/2constructor-080.adoc[`AutoDeallocator`]         [.small]#[constructor]#
| Create an auto deallocator to manage a sequence of memory blocks&period;
| xref:BloombergLP/bslma/AutoDeallocator/2destructor.adoc[`&#126;AutoDeallocator`] [.small]#[destructor]#
| Destroy this range proctor and deallocate any managed memory blocks&period;
| xref:BloombergLP/bslma/AutoDeallocator/length.adoc[`length`] 
| Return the (signed) length of the sequence of memory blocks managed by this proctor&period;
| xref:BloombergLP/bslma/AutoDeallocator/operator_inc.adoc[`operator&plus;&plus;`] 
| Increase by one the (signed) length of the managed memory&hyphen;block sequence&period;
| xref:BloombergLP/bslma/AutoDeallocator/operator_dec.adoc[`operator&hyphen;&hyphen;`] 
| Decrease by one the (signed) length of the managed memory&hyphen;block sequence&period;
| xref:BloombergLP/bslma/AutoDeallocator/release.adoc[`release`] 
| Release from management all memory blocks currently managed by this proctor&period;
| xref:BloombergLP/bslma/AutoDeallocator/reset-01.adoc[`reset`] 
| Set the origin of the sequence of memory blocks managed by this proctor&period;
| xref:BloombergLP/bslma/AutoDeallocator/setLength.adoc[`setLength`] 
| Set the (signed) length of the managed memory&hyphen;block sequence&period;
|===



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