[#BloombergLP-bslma-AllocatorUtil-deallocateObject] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslma.adoc[bslma]::xref:BloombergLP/bslma/AllocatorUtil.adoc[AllocatorUtil]::deallocateObject :relfileprefix: ../../../ :mrdocs: Deallocate raw storage previously allocated by `allocateObject`. == Synopsis Declared in `<bslma_allocatorutil.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class t_ALLOCATOR, class t_POINTER> static void deallocateObject( t_ALLOCATOR const& allocator, t_POINTER p, std::size_t n = 1); ---- == Description Return to the specified `allocator` a block of raw memory at the specified `p` address that is suitably sized and aligned to hold an object of (templatize parameter) `t_TYPE`. Optionally specify `n` for the number of objects; otherwise a single object is assumed. The behavior is undefined unless `p` refers to a block with the same type and number of objects previously allocated from a copy of `allocator` and not yet deallocated. == Parameters [cols="1,4"] |=== | Name| Description | *allocator* | allocator to which to return the memory | *p* | address of the block to deallocate | *n* | number of objects the block was sized for |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#