std::pmr::m..._deallocate(3)

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

πŸŽ€ NAME πŸŽ€

std::pmr::monotonic_buffer_resource::do_deallocate β€” ok so this is literally std::pmr::monotonic_buffer_resource::do_deallocate, bestie, that's the whole name, no notes πŸ’…


✨ Synopsis ✨

virtual void do_deallocate( void* p, std::size_t bytes, std::size_t alignment );
this one's been around since C++17 🫢

So here's the tea: this function has no effect. Like, none. Zero. It does nothing and it's not even sorry about it 😭

And honestly? That's kind of the whole point. Memory used by a monotonic_buffer_resource β€” as its name indicates β€” increases monotonically until the resource is destroyed. Monotonic. It only ever goes up πŸ“ˆ The way that deallocation simply is not on the agenda. It's giving "we don't do that here" energy and we respect it πŸ‘‘


πŸ’€ Exceptions

Throws nothing. Not a single exception. Iconic, honestly. Immaculate behaviour, no cap ✨


🌸 See also

  • deallocate β€” deallocates memory (public member function of std::pmr::memory_resource)
  • do_deallocate β€” deallocates memory [virtual] (virtual private member function of std::pmr::memory_resource)

and that's the whole page diva πŸ’– This little number comes to you from http://cppreference.com, dated 2024.06.10, filed under the C++ Standard Libary (yes, that's their spelling, I'm not fixing it πŸ™ˆ) β€” mwah, go allocate something πŸŒˆβ­πŸ“

πŸ“¦ where this page comes from