__GNU_CXX::__MT_ALLOC(3)
π NAME π
__gnu_cxx::__mt_alloc< _Tp, _Poolp > β bestie, this is a fixed size (power of 2) allocator which β when compiled with thread support β will maintain one freelist per size per thread plus a global one. Steps are taken to limit the per thread freelist sizes (by returning excess back to the global list). β¨
β¨ SYNOPSIS β¨
#include <mt_allocator.h>
Inherits __gnu_cxx::__mt_alloc_base< _Tp >. π«Ά
π Public Types π
typedef _Poolp __policy_typeβ the policy type, literally right there in the name πtypedef _Poolp::pool_type __pool_typeβ the pool type, pulled straight off the policytypedef const _Tp * const_pointerβ pointer, but make it const π§typedef const _Tp & const_referenceβ reference, but make it consttypedef std::ptrdiff_t difference_typeβ for when you gotta know the distance between two pointers, no captypedef _Tp * pointerβ your classic pointer, iconictypedef std::true_type propagate_on_container_move_assignmentβ yes, it propagates on container move assignment, periodttypedef _Tp & referenceβ reference to_Tp, we love to see ittypedef std::size_t size_typeβ sizes, sizes, sizes πΈtypedef _Tp value_typeβ the actual thing being allocated, the main character
π¦ Public Member Functions π¦
__mt_alloc (const __mt_alloc &) noexceptβ copy constructor, and she'snoexcept, as she should be πtemplate<typename _Tp1, typename _Poolp1> __mt_alloc (const __mt_alloc< _Tp1, _Poolp1 > &) noexceptβ the templated converting copy constructor, alsonoexceptπ₯const __pool_base::_Tune _M_get_options ()β grab the current tuning optionsvoid _M_set_options (__pool_base::_Tune __t)β set the tuning options to__tconst_pointer address (const_reference __x) const noexceptβ hand over the address of a const__xpointer address (reference __x) const noexceptβ hand over the address of__xpointer allocate (size_type __n, const void *=0)β allocate__nof the things, with that sneaky littleconst void *=0hint param β¨template<typename _Up, typename... _Args> void construct (_Up *__p, _Args &&... __args)β construct a_Upat__p, forwarding all the__argslike the good little perfect-forwarder she isvoid deallocate (pointer __p, size_type __n)β give it back,__nitems from__ptemplate<typename _Up> void destroy (_Up *__p)β bye bye,__pπsize_type max_size () const noexceptβ the biggest size she can handle, and she'snoexceptabout it
πΈ Detailed Description πΈ
template<typename _Tp, typename _Poolp = __common_pool_policy<__pool, true>>
class __gnu_cxx::__mt_alloc< _Tp, _Poolp >
"This is a fixed size (power of 2) allocator which - when compiled with thread support - will maintain one freelist per size per thread plus a global one. Steps are taken to limit the per thread freelist sizes (by returning excess back to the global list).
Okay so the tea β: every thread gets its own freelist per size, there's also one big global freelist, and the allocator is very careful not to let any single thread's freelists get out of hand β it sends the excess back to the global list. Vibe check: passed. π
Further details, go read the lore yourself bestie:
https://gcc.gnu.org/onlinedocs/libstdc++/manual/mt_allocator.html
π Author π
Generated automatically by Doxygen for libstdc++ from the source code. So like, nobody actually sat down and hand-wrote this, the robots did it. π€π
That's the whole page, bestie β and yes, it came to you straight from libstdc++, the __gnu_cxx::..., _Poolp >(3) manual, iykyk. Go forth and allocate 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