std::pmr::s...:do_allocate(3)
πΈ NAME πΈ
okay so this is the std::pmr::synchronized_pool_resource::do_allocate page from the C++ Standard Libary manual β yes, thatβs the manual name and weβre keeping it exactly as-is, bestie π (the page title is std::pmr::s...:do_allocate(3) if you were wondering).
std::pmr::synchronized_pool_resource::do_allocate β thatβs the function weβre obsessing over.
β¨ Synopsis β¨
virtual void* do_allocate( std::size_t bytes, std::size_t alignment );
(since C++17)
It allocates storage. Thatβs the whole main-character job, no cap.
If the pool selected for a block of size bytes canβt satisfy the request from its internal data structures, it calls allocate() on the upstream memory resource to obtain memory. like, it goes shopping upstream ποΈ
If the size requested is larger than what the largest pool can handle, memory is allocated by calling allocate() on the upstream memory resource. so basically: too big for the biggest pool? upstream gets the call.
π Return value π
A pointer to allocated storage of at least bytes bytes in size, aligned to the specified alignment if such alignment is supported, and to alignof(std::max_align_t) otherwise. β¨
π Exceptions π
Throws nothing unless calling allocate() on the upstream memory resource throws. simple as that, bestie.
π See also π
allocateβ allocates memory (public member function ofstd::pmr::memory_resource)do_allocateβ allocates memory[virtual](virtual private member function ofstd::pmr::memory_resource)
thatβs the tea π β source: http://cppreference.com β¨ version/date: 2024.06.10 β¨ page: std::pmr::s...:do_allocate(3) π
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms