std::pmr::synchronized_pool_resource:: synchronized_pool_resource
From cppreference.net
<
cpp
|
memory
|
synchronized pool resource
C++
Memory management library
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
std::pmr::synchronized_pool_resource
|
synchronized_pool_resource::synchronized_pool_resource
|
||||
| Public member functions | ||||
| Protected member functions | ||||
|
synchronized_pool_resource
(
)
;
|
(1) | (自 C++17 起) |
|
explicit
synchronized_pool_resource
(
std::
pmr
::
memory_resource
*
upstream
)
;
|
(2) | (自 C++17 起) |
|
explicit
synchronized_pool_resource
(
const
std::
pmr
::
pool_options
&
opts
)
;
|
(3) | (自 C++17 起) |
|
synchronized_pool_resource
(
const
std::
pmr
::
pool_options
&
opts,
std:: pmr :: memory_resource * upstream ) ; |
(4) | (自 C++17 起) |
|
synchronized_pool_resource
(
const
synchronized_pool_resource
&
)
=
delete
;
|
(5) | (自 C++17 起) |
构造一个
synchronized_pool_resource
。
1-4)
使用指定的上游内存资源并根据指定选项调优构造一个
未将 opts 作为参数的函数重载使用默认构造的 pool_options 实例作为选项。未将 upstream 作为参数的函数重载使用 std::pmr::get_default_resource 的返回值作为上游内存资源。
synchronized_pool_resource
。生成的对象持有
upstream
的副本,但不拥有
upstream
所指向的资源。
未将 opts 作为参数的函数重载使用默认构造的 pool_options 实例作为选项。未将 upstream 作为参数的函数重载使用 std::pmr::get_default_resource 的返回值作为上游内存资源。
5)
复制构造函数被删除。
参数
| opts | - | 包含构造函数选项的 std::pmr::pool_options 结构体 |
| upstream | - | 要使用的上游内存资源 |
异常
1-4)
仅当上游资源的
allocate()
函数调用抛出异常时才会抛出异常。是否发生此类调用及发生条件均未作规定。