__GNU_CXX::BITMAP_ALLOCATOR(3)

✨ NAME ✨

__gnu_cxx::bitmap_allocator< _Tp > β€” bestie it's the Bitmap Allocator, primary template. πŸ’…

This page lives in the Library Functions Manual, and yeah it's one of those fancy C++ header-only situation-ships. πŸ¦‹


🌈 SYNOPSIS 🌈

okay so first things first, you gotta pull it in:

#include <bitmap_allocator.h>

and heads up, it Inherits __gnu_cxx::free_list. family tree matters, periodt. 🌳


πŸŽ€ Public Types πŸŽ€

  • __mutex_type β€” a typedef of free_list::__mutex_type, borrowed from the parent, no cap
  • const_pointer β€” a typedef of const _Tp *
  • const_reference β€” a typedef of const _Tp &
  • difference_type β€” a typedef of std::ptrdiff_t
  • pointer β€” a typedef of _Tp *
  • propagate_on_container_move_assignment β€” a typedef of std::true_type, so yes, it propagates πŸ’«
  • reference β€” a typedef of _Tp &
  • size_type β€” a typedef of std::size_t
  • value_type β€” a typedef of _Tp

πŸ’– Public Member Functions πŸ’–

  • bitmap_allocator(const bitmap_allocator &) noexcept β€” copy constructor, calm and collected
  • template<typename _Tp1> bitmap_allocator(const bitmap_allocator< _Tp1 > &) noexcept β€” the templated copy-adjacent one, also unbothered
  • pointer _M_allocate_single_object() β€” Allocates memory for a single object of size sizeof(_Tp). ✨
  • void _M_deallocate_single_object(pointer __p) throw () β€” Deallocates memory that belongs to a single object of size sizeof(_Tp). 🫢
  • const_pointer address(const_reference __r) const noexcept
  • pointer address(reference __r) const noexcept
  • pointer allocate(size_type __n)
  • pointer allocate(size_type __n, typename bitmap_allocator< void >::const_pointer)
  • template<typename _Up, typename... _Args> void construct(_Up *__p, _Args &&... __args)
  • void deallocate(pointer __p, size_type __n) throw ()
  • template<typename _Up> void destroy(_Up *__p)
  • size_type max_size() const noexcept

🌸 Detailed Description 🌸

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

"Bitmap Allocator, primary template." that's literally it, that's the whole vibe. πŸ‘‘


πŸ’… Member Function Documentation πŸ’…

🌟 template<typename _Tp> pointer __gnu_cxx::bitmap_allocator< _Tp >::_M_allocate_single_object () [inline]

Allocates memory for a single object of size sizeof(_Tp). simple as that, bestie.

Exceptions

  • std::bad_alloc β€” if memory cannot be allocated. 😭 rude but real.

Complexity: worst case complexity is O(N), but that is hardly ever hit. like, almost never, fr fr. If and when this particular case is encountered, the next few cases are guaranteed to have a worst case complexity of O(1)! that's why this function performs very well on average. you can consider this function to have a complexity referred to commonly as: Amortized Constant time. ate. πŸ”₯


πŸ¦‹ template<typename _Tp> void __gnu_cxx::bitmap_allocator< _Tp >::_M_deallocate_single_object (pointer __p) [inline]

Deallocates memory that belongs to a single object of size sizeof(_Tp).

Complexity: O(lg(N)), but the worst case is not hit often! this is because containers usually deallocate memory close to each other and this case is handled in O(1) time by the deallocate function. iconic behaviour honestly. ⭐


πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for libstdc++ from the source code. so nobody actually hand-wrote this, it's giving robot energy but make it cute. πŸ€–πŸ’–


ok that's the whole page, thanks for reading my ted talk πŸŽ€

this was libstdc++'s __gnu_cxx:...tor< _Tp >(3) page β€” go forth and allocate, bestie πŸ’œπŸ«Ά

πŸ“¦ 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