std::pmr::pool_options(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

πŸ’– std::pmr::pool_options β€” from the C++ Standard Libary manual πŸ’–

🌸 NAME 🌸

std::pmr::pool_options β€” yes bestie, that’s the name, and it’s giving β€œoptions bag for pool resources” energy. πŸ’…


✨ Synopsis ✨

Defined in header <memory_resource>
struct pool_options;                 (since C++17)

Okay so std::pmr::pool_options is a set of constructor options for pool resources including std::pmr::synchronized_pool_resource and std::pmr::unsynchronized_pool_resource. Not me being dramatic β€” that is literally what it is. πŸ¦‹


πŸŽ€ Data members πŸŽ€

Two members, both std::size_t, both lowkey important. Here’s the tea:

  • std::size_t max_blocks_per_chunk; β€” the maximum number of blocks that will be allocated at once from the upstream std::pmr::memory_resource to replenish the pool. If the value of max_blocks_per_chunk is zero or is greater than an implementation-defined limit, that limit is used instead. The implementation may choose to use a smaller value than is specified in this field and may use different values for different pools. 🫢
  • std::size_t largest_required_pool_block; β€” the largest allocation size that is required to be fulfilled using the pooling mechanism. Attempts to allocate a single block larger than this threshold will be allocated directly from the upstream std::pmr::memory_resource. If largest_required_pool_block is zero or is greater than an implementation-defined limit, that limit is used instead. The implementation may choose a pass-through threshold larger than specified in this field. ✨

πŸ¦‹ See also πŸ¦‹

  • synchronized_pool_resource (C++17) β€” a thread-safe std::pmr::memory_resource for managing allocations in pools of different block sizes (class). πŸ”₯
  • unsynchronized_pool_resource (C++17) β€” a thread-unsafe std::pmr::memory_resource for managing allocations in pools of different block sizes (class). πŸ’€

That’s the whole page, bestie. Source/version: http://cppreference.com Β· date: 2024.06.10 β€” xoxo, your C++ bestie πŸ’…πŸŽ€

πŸ“¦ where this page comes from