__GNU_CXX::__POOL_ALLOC(3)

πŸ’– NAME πŸ’–

ok so bestie, welcome to __gnu_cxx::__pool_alloc< _Tp > β€” it's an allocator that uses a memory pool with a single lock. that's it, that's the whole vibe. it's from the __gnu_cxx library (you know, the GNU extensions zone) and the manual is a Library Functions Manual situation, section 3. 🧚


✨ SYNOPSIS ✨

#include <pool_allocator.h>

it inherits __gnu_cxx::__pool_alloc_base. yes queen, it's got a whole base class. πŸ‘‘


πŸŽ€ Public Types πŸŽ€

here's the whole type roster, no skips:

  • typedef const _Tp * const_pointer
  • typedef const _Tp & const_reference
  • typedef std::ptrdiff_t difference_type
  • typedef _Tp * pointer
  • typedef std::true_type propagate_on_container_move_assignment
  • typedef _Tp & reference
  • typedef std::size_t size_type
  • typedef _Tp value_type

like… the full set. pointer, reference, const_pointer, const_reference, sizes, difference type, value type, and propagate_on_container_move_assignment set to std::true_type. iconic behavior honestly. 🌈


πŸ¦‹ Public Member Functions πŸ¦‹

every single one, verbatim, because we don't gatekeep:

  • __pool_alloc (const __pool_alloc &) noexcept
  • template<typename _Tp1> __pool_alloc (const __pool_alloc< _Tp1 > &) noexcept
  • const_pointer address (const_reference __x) const noexcept
  • pointer address (reference __x) const noexcept
  • pointer allocate (size_type __n, const void *=0)
  • template<typename _Up, typename... _Args> void construct (_Up *__p, _Args &&... __args)
  • void deallocate (pointer __p, size_type __n)
  • template<typename _Up> void destroy (_Up *__p)
  • size_type max_size () const noexcept

so you got your copy constructor, your converting template constructor (both noexcept, love that for them), two address overloads β€” one const, one not β€” then the classic allocate / construct / deallocate / destroy squad, and max_size () const noexcept at the end. the whole allocation lifecycle, served. πŸ’…


πŸ’€ Detailed Description πŸ’€

template<typename _Tp>
class __gnu_cxx::__pool_alloc< _Tp >
"Allocator using a memory pool with a single lock."

that's the official description, word for word, and it's lowkey the whole point: it's a template class over _Tp, and it allocates out of a memory pool guarded by one single lock. one lock. not a million. 🫢


🌸 Author 🌸

Generated automatically by Doxygen for libstdc++ from the source code. so nobody hand-wrote this, it's the robot doing its thing. πŸ€–


ok bestie that's the whole page, tysm for reading πŸ₯° this was libstdc++ documenting __gnu_cxx::__pool_alloc< _Tp > in section 3, fr fr. mwah, go allocate something responsibly. πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from
  • arch rolling: gcc 16.2.1+r23+gd564253eb6c8-1 Β· GPL-3.0-or-later WITH GCC-exception-3.1 AND GFDL-1.3-or-later
  • fedora 44: libstdc++-docs 16.0.1-0.10.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
  • fedora 44: libstdc++-docs 16.2.1-2.fc44
  • fedora 44: libstdc++-docs 16.2.1-3.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms