__gnu_cxx::__pool_alloc_base(3cxx)

πŸ’… __gnu_cxx::__pool_alloc_base(3cxx) β€” the libstdc++ manual, but make it make sense

okay so welcome to the libstdc++ page for __gnu_cxx::__pool_alloc_base, bestie. It's the base-class icon behind __pool_alloc, and we're gonna get into it. 🫢

✨ NAME ✨

__gnu_cxx::__pool_alloc_base β€” Base class for __pool_alloc. periodt.

🌸 SYNOPSIS 🌸

pull it in with:

#include <pool_allocator.h>

also inherited by __gnu_cxx::__pool_alloc< _Tp > [private]. iykyk. πŸ’…

πŸŽ€ Protected Types πŸŽ€

these are the protected type members, no cap:

  • enum { _S_align }
  • enum { _S_max_bytes }
  • enum { _S_free_list_size }

πŸ”₯ Protected Member Functions πŸ”₯

the protected member functions, exactly as they appear:

  • char * _M_allocate_chunk (size_t __n, int &__nobjs)
  • _Obj *volatile * _M_get_free_list (size_t __bytes) throw ()
  • __mutex & _M_get_mutex () throw ()
  • void * _M_refill (size_t __n)
  • size_t _M_round_up (size_t __bytes)

πŸ¦‹ Static Protected Attributes πŸ¦‹

static protected attributes, slay:

  • static char * _S_end_free
  • static _Obj *volatile _S_free_list [_S_free_list_size]
  • static size_t _S_heap_size
  • static char * _S_start_free

πŸ’– Detailed Description πŸ’–

so __gnu_cxx::__pool_alloc_base is the Base class for __pool_alloc. It uses various allocators to fulfill underlying requests, and it makes as few requests as possible when it's in default high-speed pool mode. obsessed.

the important implementation properties are literally:

  • 0. If it's globally mandated, then objects get allocated from new.
  • 1. If the clients request an object of size > _S_max_bytes, that resulting object is obtained directly from new.
  • 2. In every other case, we allocate an object of size exactly _S_round_up(requested_size). That way the client has enough size information for us to return the object to the proper free list without permanently losing part of the object.

πŸ“œ Author πŸ“œ

Generated automatically by Doxygen for libstdc++ from the source code. iconic behavior, honestly.


and that's the whole page, bestie 🧚 the footer/source line is libstdc++ + __gnu_cxx::__pool_alloc_base(3cxx) β€” that's the source/version bit, and there's no date shown on this page, just that footer energy. πŸ«ΆπŸ’–