std::experi...fer_resource(3)
πΈ NAME πΈ
okay so bestie, we're in the C++ Standard Library man page for std::experimental::pmr::monotonic_buffer_resource β the page title is std::experi...fer_resource(3), and the header literally spells it βC++ Standard Libaryβ (typo and all, we love that for us). This class is the main character here. π
β¨ Synopsis β¨
Defined in header <experimental/memory_resource>:
class monotonic_buffer_resource : public memory_resource; (library fundamentals TS)
std::experimental::pmr::monotonic_buffer_resource is a special-purpose memory resource class, and its whole vibe is that it releases the allocated memory only when the resource is destroyed. Itβs intended for very fast memory allocations in situations where memory is used to build up a few objects and then is released all at once β like, build build build, then yeet the whole thing. π«Ά
You can construct monotonic_buffer_resource with an initial buffer. If there is no initial buffer, or if the buffer is exhausted, additional buffers are obtained from an upstream memory resource supplied at construction. The size of buffers obtained follows a geometric progression. No cap. β¨
π¨ vibe check: monotonic_buffer_resource is not thread-safe. Thatβs the warning, periodt. π
π Member functions π
hereβs the roster, bestie:
- constructor β constructs a
monotonic_buffer_resource(public member function). - destructor β destroys a
monotonic_buffer_resource, releasing all allocated memory ([virtual]virtual public member function). operator=β the copy assignment operator is deleted, somonotonic_buffer_resourceis not copy assignable ([deleted]public member function).
π«Ά Public member functions π«Ά
releaseβ release all allocated memory (public member function).upstream_resourceβ returns a pointer to the upstream memory resource (public member function).
π Protected member functions π
do_allocateβ allocate memory ([virtual]virtual protected member function).do_deallocateβ no-op ([virtual]virtual protected member function).do_is_equalβ compare for equality with anothermemory_resource([virtual]virtual protected member function).
π·οΈ Category π·οΈ
- Noindexed pages
mwah π β source/version is http://cppreference.com, dated 2024.06.10, and the page is std::experi...fer_resource(3). Thatβs the footer, folded into this cute lil sign-off. byeee π¦
π¦ 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