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

Deallocate a block of raw memory previously allocated by `allocateBytes`&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;ALLOCATOR&gt;
static
void
deallocateBytes(
    t&lowbar;ALLOCATOR const& allocator,
    AllocatorUtil&lowbar;Traits&lt;t&lowbar;ALLOCATOR&gt;::void&lowbar;pointer p,
    std::size&lowbar;t nbytes,
    std::size&lowbar;t alignment = 0);
----

== Description

Give back, to the specified `allocator`, the block of raw memory at the specified `p` address having the specified `nbytes` size and optionally specified `alignment`&period; If `alignment` is not specified, the natural alignment for an object of size `nbytes` is used&period; The behavior is undefined unless `p` refers to a block having the same size and alignment previously allocated from a copy of `allocator` and not yet deallocated&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *allocator*
| allocator to which to return the memory
| *p*
| address of the block to deallocate
| *nbytes*
| size in bytes of the block at `p`
| *alignment*
| alignment used when the block was allocated&semi; 0 means natural alignment
|===


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