std::pmr::p...locate_bytes(3)
π std::pmr::p...locate_bytes(3) β C++ Standard Libary π
okay bestie, welcome to the C++ Standard Libary corner of the manualverse π
We're reading std::pmr::p...locate_bytes(3), and the p...locate is just the truncation being dramatic. The actual function is std::pmr::polymorphic_allocator::deallocate_bytes, and yes she has main character energy.
πΈ NAME πΈ
std::pmr::polymorphic_allocator::deallocate_bytes β std::pmr::polymorphic_allocator::deallocate_bytes.
Literally the same name twice, and honestly? iconic π«Ά
β¨ Synopsis β¨
The signature, served fresh:
void deallocate_bytes( void* p,
std::size_t nbytes,
std::size_t alignment = alignof(std::max_align_t) );
Tagged (since C++20), so set your mental compiler to C++20 mode β
Okay so deallocate_bytes deallocates the storage pointed to by p, and that p must have been allocated from a std::pmr::memory_resource x that compares equal to *resource(), using x.allocate(nbytes, alignment) β typically through a call to allocate_bytes(nbytes, alignment).
It's equivalent to:
resource()->deallocate(p, nbytes, alignment);
π Parameters π
pβ pointer to memory to deallocate. bye-bye, memory πnbytesβ the number of bytes originally allocated.alignmentβ the alignment originally allocated.
π Exceptions π
Throws nothing. That's it. no drama, no surprise throws, just peace and quiet π
π¦ Notes π¦
This function was introduced for use with the fully-specialized allocator std::pmr::polymorphic_allocator<>, but it may be useful in any specialization. cute versatility, no cap β¨
π See Also π
deallocate_object(C++20)β frees raw memory obtained byallocate_object(public member function).delete_object(C++20)β destroys and deallocates an object (public member function).deallocate[static]β deallocates storage using the allocator (public static member function ofstd::allocator_traits<Alloc>).deallocateβ deallocates memory (public member function ofstd::pmr::memory_resource).
kisses bestie, this page came from http://cppreference.com, dated 2024.06.10, and it's the std::pmr::p...locate_bytes(3) manual 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