std::pmr::unsyn...d_pool_resource(3cxx)

πŸ’– std::pmr::unsynchronized_pool_resource β€” NAME πŸŽ€

okay so bestie, welcome to std::pmr::unsynchronized_pool_resource β€” it's a non-thread-safe memory resource that manages pools of fixed-size blocks. that's the whole vibe. it's giving allocator but make it ✨organized✨. this page lives in section 3cxx of the manual, iykyk.


🌸 SYNOPSIS 🌸

#include <memory_resource>

Inherits std::pmr::memory_resource. periodt, that's the parent.

✨ Public Member Functions ✨

  • unsynchronized_pool_resource (const pool_options &__opts) β€” build one with the options you picked out πŸ’…
  • unsynchronized_pool_resource (const pool_options &__opts, memory_resource *__upstream) β€” same energy, but you also hand it an upstream resource
  • unsynchronized_pool_resource (const unsynchronized_pool_resource &)=delete β€” nope, no copying, it's deleted, don't even try πŸ™ˆ
  • unsynchronized_pool_resource (memory_resource *__upstream) β€” constructor that just takes the upstream resource
  • void * allocate (size_t __bytes, size_t __alignment=_S_max_align) β€” gimme memory, and __alignment defaults to _S_max_align
  • void deallocate (void *__p, size_t __bytes, size_t __alignment=_S_max_align) β€” give it back, same default _S_max_align for the alignment
  • bool is_equal (const memory_resource &__other) const noexcept β€” compares itself to __other, and it's noexcept so no drama
  • unsynchronized_pool_resource & operator= (const unsynchronized_pool_resource &)=delete β€” assignment also deleted, literally cannot be copied into
  • pool_options options () const noexcept β€” hands you back the pool_options, noexcept ofc
  • void release () β€” drop everything, free the pools 🫢
  • memory_resource * upstream_resource () const noexcept β€” tells you who the upstream resource is, noexcept

πŸ¦‹ Protected Member Functions πŸ¦‹

  • void * do_allocate (size_t __bytes, size_t __alignment) override β€” the override that does the actual allocating
  • void do_deallocate (void *__p, size_t __bytes, size_t __alignment) override β€” the override that does the actual deallocating
  • bool do_is_equal (const memory_resource &__other) const noexcept override β€” the override for the equality check, noexcept

πŸ’œ Detailed Description πŸ’œ

A non-thread-safe memory resource that manages pools of fixed-size blocks. like, it pools your fixed-size blocks so you don't have to. main character energy for allocators fr fr. πŸ’€

Since C++17 ⭐ (yes she's been iconic since C++17)


🧚 Member Function Documentation 🧚

πŸ“ void * std::pmr::unsynchronized_pool_resource::do_allocate (size_t __bytes, size_t __alignment) [override], [protected], [virtual]

Implements std::pmr::memory_resource. that's it, that's the whole note πŸ’… but like, important β€” [override], [protected], [virtual], all three.

πŸ”₯ void std::pmr::unsynchronized_pool_resource::do_deallocate (void * __p, size_t __bytes, size_t __alignment) [override], [protected], [virtual]

Implements std::pmr::memory_resource. again, [override], [protected], [virtual] β€” she's got the full set πŸ‘‘

🌈 bool std::pmr::unsynchronized_pool_resource::do_is_equal (const memory_resource & __other) const [inline], [override], [protected], [virtual], [noexcept]

Implements std::pmr::memory_resource. and look at all those tags: [inline], [override], [protected], [virtual], [noexcept] β€” overachiever, we love to see it 🫢


πŸŽ€ Author πŸŽ€

Generated automatically by Doxygen for libstdc++ from the source code. no human wrote this one, it's a Doxygen girlie πŸ€–πŸ’–

lowkey reminder bestie: non-thread-safe. if multiple threads are gonna touch this, that's a whole different resource, don't come for me 😭

kisses and bye-byes πŸ¦‹ this was std::pmr::unsynchronized_pool_resource, from the 3cxx manual β€” that footer energy is all libstdc++ source-code realness, generated by Doxygen, date vibes courtesy of the libstdc++ docs themselves. slay responsibly πŸ’…βœ¨

πŸ“¦ where this page comes from