std::pmr::monotonic_buffer_resource:: monotonic_buffer_resource
From cppreference.net
<
cpp
|
memory
|
monotonic buffer resource
C++
Memory management library
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
std::pmr::monotonic_buffer_resource
|
monotonic_buffer_resource::monotonic_buffer_resource
|
||||
| Public member functions | ||||
| Protected member functions | ||||
|
monotonic_buffer_resource
(
)
;
|
(1) | (自 C++17 起) |
|
explicit
monotonic_buffer_resource
(
std::
pmr
::
memory_resource
*
upstream
)
;
|
(2) | (自 C++17 起) |
|
explicit
monotonic_buffer_resource
(
std::
size_t
initial_size
)
;
|
(3) | (自 C++17 起) |
|
monotonic_buffer_resource
(
std::
size_t
initial_size,
std:: pmr :: memory_resource * upstream ) ; |
(4) | (自 C++17 起) |
|
monotonic_buffer_resource
(
void
*
buffer,
std::
size_t
buffer_size
)
;
|
(5) | (自 C++17 起) |
|
monotonic_buffer_resource
(
void
*
buffer,
std::
size_t
buffer_size,
std:: pmr :: memory_resource * upstream ) ; |
(6) | (自 C++17 起) |
|
monotonic_buffer_resource
(
const
monotonic_buffer_resource
&
)
=
delete
;
|
(7) | (自 C++17 起) |
构造一个
monotonic_buffer_resource
。不接收上游内存资源指针的构造函数将使用
std::pmr::get_default_resource
的返回值作为上游内存资源。
1,2)
将
当前缓冲区
设为空,并将
下一缓冲区大小
设为实现定义的尺寸。
3,4)
将
当前缓冲区
设置为空,并将
下一个缓冲区大小
设置为不小于
initial_size
的大小。
5,6)
将
当前缓冲区
设置为
buffer
,并将
下一个缓冲区大小
设置为
buffer_size
(但不小于1)。随后按实现定义的增长因子(不必为整数)增加
下一个缓冲区大小
。
7)
复制构造函数被删除。
参数
| upstream | - | 要使用的上游内存资源;必须指向有效的内存资源 |
| initial_size | - | 初始分配的缓冲区最小大小;必须大于零 |
| buffer | - | 要使用的初始缓冲区 |
| buffer_size | - |
初始缓冲区的大小;不能超过
buffer
中的字节数
|