Namespaces
Variants
Views
Actions

std::pmr::pool_options

From cppreference.com
< cpp‎ | memory
 
 
Utilities library
General utilities
Date and time
Function objects
Formatting library (C++20)
(C++11)
Relational operators (deprecated in C++20)
Integer comparison functions
(C++20)(C++20)(C++20)   
(C++20)
Swap and type operations
(C++14)
(C++11)
(C++11)
(C++11)
(C++17)
Common vocabulary types
(C++11)
(C++17)
(C++17)
(C++17)
(C++11)
(C++17)
(C++23)
Elementary string conversions
(C++17)
(C++17)
 
Dynamic memory management
Smart pointers
(C++11)
(C++11)
(C++11)
(until C++17)
(C++11)
(C++23)
Allocators
Memory resources
pmr::pool_options
(C++17)
Uninitialized storage
Uninitialized memory algorithms
Constrained uninitialized memory algorithms
Garbage collection support
(C++11)(until C++23)
(C++11)(until C++23)
(C++11)(until C++23)
(C++11)(until C++23)
(C++11)(until C++23)
(C++11)(until C++23)
Miscellaneous
(C++20)
(C++11)
(C++11)
Low level memory management
 
Defined in header <memory_resource>
struct pool_options;
(since C++17)

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.

[edit] Data members

Member Meaning
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.


[edit] See also

a thread-safe std::pmr::memory_resource for managing allocations in pools of different block sizes
(class) [edit]
a thread-unsafe std::pmr::memory_resource for managing allocations in pools of different block sizes
(class) [edit]