40 #ifndef LIBPMEMOBJ_CPP_MAKE_PERSISTENT_ATOMIC_HPP
41 #define LIBPMEMOBJ_CPP_MAKE_PERSISTENT_ATOMIC_HPP
48 #include "libpmemobj/atomic_base.h"
73 template <
typename T,
typename... Args>
75 make_persistent_atomic(pool_base &pool,
76 typename detail::pp_if_not_array<T>::type &ptr,
79 std::tuple<Args &...> arg_pack{args...};
80 auto ret = pmemobj_alloc(pool.handle(), ptr.raw_ptr(),
sizeof(T),
81 detail::type_num<T>(),
82 &detail::obj_constructor<T, Args...>,
83 static_cast<void *
>(&arg_pack));
86 throw std::bad_alloc();
101 delete_persistent_atomic(
102 typename detail::pp_if_not_array<T>::type &ptr) noexcept
108 pmemobj_free(ptr.raw_ptr());
Commonly used functionality.
Compile time type check for make_persistent.
Implementation details of atomic allocation and construction.
Definition: allocator.hpp:48