PMDK C++ bindings
1.7
This is the C++ bindings documentation for PMDK's libpmemobj.
|
Go to the documentation of this file.
40 #ifndef LIBPMEMOBJ_CPP_MAKE_PERSISTENT_ATOMIC_HPP
41 #define LIBPMEMOBJ_CPP_MAKE_PERSISTENT_ATOMIC_HPP
51 #include <libpmemobj/atomic_base.h>
77 template <
typename T,
typename... Args>
83 auto arg_pack = std::forward_as_tuple(std::forward<Args>(args)...);
84 auto ret = pmemobj_xalloc(
85 pool.handle(), ptr.raw_ptr(),
sizeof(T), detail::type_num<T>(),
87 &detail::obj_constructor<T, decltype(arg_pack), Args...>,
88 static_cast<void *
>(&arg_pack));
91 throw std::bad_alloc();
109 template <
typename T,
typename... Args>
110 typename std::enable_if<!detail::is_first_arg_same<allocation_flag_atomic,
111 Args...>::value>::type
117 std::forward<Args>(args)...);
130 template <
typename T>
139 pmemobj_free(ptr.raw_ptr());
Atomic persistent_ptr allocation functions for arrays.
Commonly used functionality.
void delete_persistent_atomic(typename detail::pp_if_array< T >::type &ptr, std::size_t)
Atomically deallocate an array of objects.
Definition: make_persistent_array_atomic.hpp:135
Compile time type check for make_persistent.
Implementation details of atomic allocation and construction.
Type of flag which can be passed to make_persistent_atomic.
Definition: allocation_flag.hpp:123
Persistent pointer class.
Definition: persistent_ptr.hpp:132
PMEMobj pool class.
Definition: pool.hpp:431
static allocation_flag_atomic none()
Do not change allocator behaviour.
Definition: allocation_flag.hpp:144
Helper functionality for handling variadic templates.
allocation_flag - defines flags which can be passed to make_persistent
The non-template pool base class.
Definition: pool.hpp:67
void 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.
Definition: make_persistent_array_atomic.hpp:75