__GNU_CXX::__POOL_ALLOC(3cxx)

Bestie, welcome to the 3cxx manual page for __gnu_cxx::__pool_alloc< _Tp > πŸ’– We're doing the whole thing, no skips, no cap.

🌸 NAME 🌸

__gnu_cxx::__pool_alloc< _Tp > β€” an allocator that uses a memory pool with a single lock. That's the name-and-game, periodt. ✨

πŸ¦‹ SYNOPSIS πŸ¦‹

Start with this include, bestie:

#include <pool_allocator.h>

Also important: it inherits __gnu_cxx::__pool_alloc_base. Keeping the inheritance receipts, always. 🧾

πŸ’… Public Types πŸ’…

  • typedef const _Tp * const_pointer β€” a pointer that points at a const _Tp.
  • typedef const _Tp & const_reference β€” a reference to a const _Tp.
  • typedef std::ptrdiff_t difference_type β€” the difference type is std::ptrdiff_t.
  • typedef _Tp * pointer β€” a pointer to _Tp.
  • typedef std::true_type propagate_on_container_move_assignment β€” this one is literally std::true_type.
  • typedef _Tp & reference β€” a reference to _Tp.
  • typedef std::size_t size_type β€” the size type is std::size_t.
  • typedef _Tp value_type β€” the value type is _Tp.

πŸ‘‘ Public Member Functions πŸ‘‘

  • __pool_alloc (const __pool_alloc &) noexcept β€” copy constructor, and it's noexcept.
  • template<typename _Tp1 > __pool_alloc (const __pool_alloc< _Tp1 > &) noexcept β€” converting constructor template from __pool_alloc< _Tp1 >, also noexcept.
  • const_pointer address (const_reference __x) const noexcept β€” const address overload, returns const_pointer, noexcept.
  • pointer address (reference __x) const noexcept β€” non-const-reference address overload, returns pointer, noexcept.
  • pointer allocate (size_type __n, const void *=0) β€” allocates using size_type __n, and that second parameter defaults to 0.
  • template<typename _Up , typename... _Args> void construct (_Up *__p, _Args &&... __args) β€” variadic construct for a _Up *__p and _Args &&... __args.
  • void deallocate (pointer __p, size_type __n) β€” deallocates pointer __p with size_type __n.
  • template<typename _Up > void destroy (_Up *__p) β€” template destroy for a _Up *__p.
  • size_type max_size () const noexcept β€” returns size_type, and yes bestie, it's const noexcept.

✨ Detailed Description ✨

Template time:

template<typename _Tp>
    class __gnu_cxx::__pool_alloc< _Tp >

And the description is right there: an allocator using a memory pool with a single lock. That's the whole iconic little class. 🌈

🫢 Author 🫢

Generated automatically by Doxygen for libstdc++ from the source code. So it's not a human author moment, it's Doxygen doing its thing. πŸ’…


Sign-off: source/version energy is libstdc++, manual section 3cxx; the original footer doesn't give a date, so there's no date to spill. Mwah πŸ’‹βœ¨