std::pmr::p...cate_object(3)
π NAME π
std::pmr::polymorphic_allocator::deallocate_object β std::pmr::polymorphic_allocator::deallocate_object. Yep, the NAME section said it twice and we're keeping both, bestie. This is the std::pmr::p...cate_object(3) page from the C++ Standard Libary manual. π«Ά
β¨ Synopsis β¨
Okay so it's a template, and it's been a thing since C++20:
template< class U >
void deallocate_object( U* p, std::size_t n = 1 );
It deallocates the storage pointed to by p. Big caveat: p must have been allocated from a std::pmr::memory_resource x that compares equal to *resource(), using x.allocate(n * sizeof(U), alignof(U)) β typically through a call to allocate_object<U>(n). The provenance is giving required, no cap. π
It's equivalent to deallocate_bytes(p, n * sizeof(U), alignof(U));.
π Parameters π
pβ pointer to the memory to deallocate.nβ number of objects of typeUthe memory was for.
π Exceptions π
Throws nothing. Literally zero drama. β¨
π¦ Notes π¦
This function was introduced for use with the fully-specialized allocator std::pmr::polymorphic_allocator<>, but it may be useful in any specialization. Highkey flexible icon behavior. π
πΈ See also πΈ
deallocate_bytesβ frees raw memory obtained fromallocate_bytes(C++20) (public member function).delete_objectβ destroys and deallocates an object (C++20) (public member function).deallocateβ deallocates storage using the allocator [static] (public static member function ofstd::allocator_traits<Alloc>).deallocateβ deallocates memory (public member function ofstd::pmr::memory_resource).
Later, bestie! π«Ά Source/version: http://cppreference.com; date: 2024.06.10. That was the std::pmr::p...cate_object(3) page β mwah! ππ
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms