[#BloombergLP-bslma-TestAllocator-deallocate-0c]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslma.adoc[bslma]::xref:BloombergLP/bslma/TestAllocator.adoc[TestAllocator]::deallocate
:relfileprefix: ../../../
:mrdocs:

Return the memory block at the specified `address` back to this allocator&period; If `address` is 0, this function has no effect (other than to record relevant statistics)&period; Otherwise, if the memory at `address` is consistent with being allocated from this test allocator, decrement the number of currently allocated blocks, and decrease the number of currently allocated bytes by the size (in bytes) originally requested for the block&period; Although technically undefined behavior, if the memory can be determined not to have been allocated from this test allocator, increment the number of mismatches, and &hyphen;&hyphen; unless in quiet mode &hyphen;&hyphen; immediately report the details of the mismatch to `stdout` (e&period;g&period;, as an `std&colon;&colon;hex` memory dump) and abort&period;

== Synopses

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

Return the memory block at the specified `address` back to this allocator&period; If `address` is 0, this function has no effect (other than to record relevant statistics)&period; Otherwise, if the memory at `address` is consistent with being allocated from this test allocator, decrement the number of currently allocated blocks, and decrease the number of currently allocated bytes by the size (in bytes) originally requested for the block&period; Although technically undefined behavior, if the memory can be determined not to have been allocated from this test allocator, increment the number of mismatches, and &hyphen;&hyphen; unless in quiet mode &hyphen;&hyphen; immediately report the details of the mismatch to `stdout` (e&period;g&period;, as an `std&colon;&colon;hex` memory dump) and abort&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
virtual
void
xref:BloombergLP/bslma/TestAllocator/deallocate-01.adoc[deallocate](void* address) override;
----

[.small]#xref:BloombergLP/bslma/TestAllocator/deallocate-01.adoc[_» more&period;&period;&period;_]#


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
xref:BloombergLP/bslma/Allocator/deallocate-077.adoc[deallocate](
    void* &lowbar;&lowbar;p,
    size&lowbar;t &lowbar;&lowbar;bytes,
    size&lowbar;t &lowbar;&lowbar;alignment = &lowbar;S&lowbar;max&lowbar;align);
----

[.small]#xref:BloombergLP/bslma/Allocator/deallocate-077.adoc[_» more&period;&period;&period;_]#


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