PMDK C++ bindings
1.7
This is the C++ bindings documentation for PMDK's libpmemobj.
|
Atomic persistent_ptr allocation functions for arrays. More...
#include <libpmemobj++/allocation_flag.hpp>
#include <libpmemobj++/detail/array_traits.hpp>
#include <libpmemobj++/detail/check_persistent_ptr_array.hpp>
#include <libpmemobj++/detail/common.hpp>
#include <libpmemobj++/detail/make_atomic_impl.hpp>
#include <libpmemobj++/detail/pexceptions.hpp>
#include <libpmemobj++/detail/variadic.hpp>
#include <libpmemobj/atomic_base.h>
Go to the source code of this file.
Functions | |
template<typename T > | |
void | pmem::obj::make_persistent_atomic (pool_base &pool, typename detail::pp_if_array< T >::type &ptr, std::size_t N, allocation_flag_atomic flag=allocation_flag_atomic::none()) |
Atomically allocate an array of objects. More... | |
template<typename T > | |
void | pmem::obj::make_persistent_atomic (pool_base &pool, typename detail::pp_if_size_array< T >::type &ptr, allocation_flag_atomic flag=allocation_flag_atomic::none()) |
Atomically allocate an array of objects. More... | |
template<typename T > | |
void | pmem::obj::delete_persistent_atomic (typename detail::pp_if_array< T >::type &ptr, std::size_t) |
Atomically deallocate an array of objects. More... | |
template<typename T > | |
void | pmem::obj::delete_persistent_atomic (typename detail::pp_if_size_array< T >::type &ptr) |
Atomically deallocate an array of objects. More... | |
Atomic persistent_ptr allocation functions for arrays.
The typical usage examples would be:
void pmem::obj::delete_persistent_atomic | ( | typename detail::pp_if_array< T >::type & | ptr, |
std::size_t | |||
) |
Atomically deallocate an array of objects.
There is no way to atomically destroy an object. Any object specific cleanup must be performed elsewhere. Do NOT use this inside transactions, as it might lead to undefined behavior in the presence of transaction aborts.
param[in,out] ptr the persistent_ptr whose pointee is to be deallocated.
void pmem::obj::delete_persistent_atomic | ( | typename detail::pp_if_size_array< T >::type & | ptr | ) |
Atomically deallocate an array of objects.
There is no way to atomically destroy an object. Any object specific cleanup must be performed elsewhere. Do NOT use this inside transactions, as it might lead to undefined behavior in the presence of transaction aborts.
param[in,out] ptr the persistent_ptr whose pointee is to be deallocated.
void pmem::obj::make_persistent_atomic | ( | pool_base & | pool, |
typename detail::pp_if_array< T >::type & | ptr, | ||
std::size_t | N, | ||
allocation_flag_atomic | flag = allocation_flag_atomic::none() |
||
) |
Atomically allocate an array of objects.
This function can be used to atomically allocate an array of objects. Cannot be used for simple objects. Do NOT use this inside transactions, as it might lead to undefined behavior in the presence of transaction aborts.
[in,out] | pool | the pool from which the object will be allocated. |
[in,out] | ptr | the persistent pointer to which the allocation will take place. |
[in] | N | the number of array elements. |
[in] | flag | affects behaviour of allocator |
std::bad_alloc | on allocation failure. |
void pmem::obj::make_persistent_atomic | ( | pool_base & | pool, |
typename detail::pp_if_size_array< T >::type & | ptr, | ||
allocation_flag_atomic | flag = allocation_flag_atomic::none() |
||
) |
Atomically allocate an array of objects.
This function can be used to atomically allocate an array of objects. Cannot be used for simple objects. Do NOT use this inside transactions, as it might lead to undefined behavior in the presence of transaction aborts.
[in,out] | pool | the pool from which the object will be allocated. |
[in,out] | ptr | the persistent pointer to which the allocation will take place. |
[in] | flag | affects behaviour of allocator |
std::bad_alloc | on allocation failure. |