std::experi...::deallocate(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

okay bestie, welcome to the std::experi...::deallocate(3) page from the C++ Standard Libary manual β€” yes, that manual name is literally right there, tucked in like a lil name tag. This one is all about std::experimental::pmr::memory_resource::deallocate, and it is lowkey iconic for being extremely specific about when you're allowed to call it. 🫢

✨ NAME ✨

std::experimental::pmr::memory_resource::deallocate β€” and the name again, because the original said it twice and we are not skipping: std::experimental::pmr::memory_resource::deallocate.

🌸 Synopsis 🌸

Here's the signature, copied exactly with all its little details:

void* deallocate( void* p, std::size_t bytes, std::size_t alignment = alignof(std::max_align_t) );

(library fundamentals TS)

deallocate deallocates the storage pointed to by p. No cap, that's the whole job. 🧹

Now the rules, bestie, because this is one of those functions with requirements and they are not vibes-based: p shall have been returned by a prior call to allocate(bytes, alignment) on a memory_resource that compares equal to *this, and the storage it points to shall not yet have been deallocated. Periodt. πŸ’…

Equivalent to return do_deallocate(p, bytes, alignment);.

πŸ’€ Exceptions πŸ’€

Throws nothing. Not a single exception. It is giving calm, unbothered, zero-drama energy. 😌

πŸ‘€ See also πŸ‘€

  • do_deallocate β€” deallocates memory; [virtual] (virtual protected member function). This is the other lil guy in the story. πŸ¦‹

🏷️ Category 🏷️

  • Noindexed pages

mwah πŸ’‹ β€” page pulled from http://cppreference.com, version/date 2024.06.10, and yeah, the page name is std::experi...::deallocate(3). bye bestie! 🌈

πŸ“¦ where this page comes from