std::pmr::monotonic_buffer_resource::monotonic_buffer_resource
STD::PMR:单调[医]缓冲器[医]资源::单调[医]缓冲器[医]资源
monotonic_buffer_resource( | (1) | (since C++17) |
---|---|---|
explicit monotonic_buffer_resource(std::pmr::memory_resource* upstream | (2) | (since C++17) |
explicit monotonic_buffer_resource(std::size_t initial_size | (3) | (since C++17) |
monotonic_buffer_resource(std::size_t initial_size, std::pmr::memory_resource* upstream | (4) | (since C++17) |
monotonic_buffer_resource(void* buffer, std::size_t buffer_size | (5) | (since C++17) |
monotonic_buffer_resource(void* buffer, std::size_t buffer_size, std::pmr::memory_resource* upstream | (6) | (since C++17) |
monotonic_buffer_resource(const monotonic_buffer_resource&) = delete; | (7) | (since C++17) |
构造一个monotonic_buffer_resource
不接受上游内存资源指针的构造函数使用std::pmr::get_default_resource
作为上游内存资源。
1-2%29设置电流缓冲器
若为空,则为下一缓冲区大小
到实现定义的大小。
3-4%29电流缓冲器
若为空,则为下一缓冲区大小
大小不小于initial_size
...
5-6%29电流缓冲器
到buffer
而下一缓冲区大小
到buffer_size
%28但不少于1%29。然后增加下一缓冲区大小
通过实现定义的增长因子%28,它不必是整数%29。
7%29复制构造函数被删除。
参数
upstream | - | the upstream memory resource to use; must point to a valid memory resource |
---|---|---|
initial_size | - | the minimum size of the first buffer to allocate; must be greater than zero |
buffer | - | the initial buffer to use |
buffer_size | - | the size of the initial buffer; cannot be greater than the number of bytes in buffer |
© cppreference.com
在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。
http://en.cppreference.com/w/cpp/Memory/单调[医]缓冲器[医]资源/单调[医]缓冲器[医]资源