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

Create an auto deallocator to manage a sequence of memory blocks&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
AutoDeallocator(
    void** origin,
    ALLOCATOR* allocator,
    int length = 0);
----

== Description

Create an auto deallocator to manage a sequence of memory blocks at the specified `origin`, and that uses the specified `allocator` to deallocate the sequence of memory blocks managed by this range proctor (if not released &hyphen;&hyphen; see `release`) upon destruction&period; Optionally specify `length` to define its range, which by default is empty (i&period;e&period;, `length &equals; 0`)&period; The sequence of memory blocks may extend in either direction from `origin`&period; A positive `length` represents the sequence of memory blocks starting at `origin` and extending &quot;up&quot; to `length` (_not_ including the memory block at the index position `origin &plus; length`)&period; A negative `length` represents the sequence of memory blocks starting at one position below `origin` and extending &quot;down&quot; to the absolute value of `length` (including the memory block at index position `origin &plus; length`)&period; If `length` is 0, then this range proctor manages no memory blocks&period; If `origin` is non&hyphen;zero, all memory blocks within the proctored range (if any) must be supplied by `allocator`&period; The behavior is undefined unless `allocator` is non&hyphen;zero, and, if `origin` is 0, `length` is also 0&period; Note that when `length` is non&hyphen;positive, the memory block at the origin is _not_ managed by this range proctor&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *origin*
| The address of the origin memory block pointer&period;
| *allocator*
| The allocator used to deallocate managed memory blocks&period;
| *length*
| The signed length of the managed memory block sequence&period;
|===


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