PMDK C++ bindings
1.13.0-git107.g7e59f08f
This is the C++ bindings documentation for PMDK's libpmemobj.
|
(EXPERIMENTAL) Encapsulates the information about the persistent memory allocation model using PMDK's libpmemobj. More...
#include <libpmemobj++/allocator.hpp>
Classes | |
struct | rebind |
Rebind to a different type. More... | |
Public Types | |
using | size_type = typename AllocationPolicy::size_type |
using | pointer = typename AllocationPolicy::pointer |
using | value_type = typename AllocationPolicy::value_type |
using | const_void_pointer = persistent_ptr< const void > |
using | bool_type = bool |
using | const_pointer = persistent_ptr< const value_type > |
using | reference = value_type & |
using | const_reference = const value_type & |
Public Member Functions | |
allocator ()=default | |
Defaulted constructor. | |
~allocator ()=default | |
Defaulted destructor. | |
allocator (allocator const &rhs) | |
Copy constructor. | |
template<typename U > | |
allocator (allocator< U > const &) | |
Type converting constructor. | |
template<typename U , typename P , typename T2 > | |
allocator (allocator< U, P, T2 > const &rhs) | |
Type converting constructor. | |
pointer | allocate (size_type cnt, const_void_pointer=0) |
Allocate storage for cnt objects of type T. More... | |
void | deallocate (pointer p, size_type=0) |
Deallocates storage pointed to p, which must be a value returned by a previous call to allocate that has not been invalidated by an intervening call to deallocate. More... | |
size_type | max_size () const |
The largest value that can meaningfully be passed to allocate(). More... | |
void | construct (pointer p, const_reference t) |
Create an object at a specific address. More... | |
template<typename... Args> | |
void | construct (pointer p, Args &&... args) |
Create an object at a specific address. More... | |
void | destroy (pointer p) |
Destroy an object based on a pointer. More... | |
Related Functions | |
(Note that these are not member functions.) | |
template<typename T , typename P , typename Tr , typename T2 , typename P2 , typename Tr2 > | |
bool | operator== (const allocator< T, P, Tr > &lhs, const allocator< T2, P2, Tr2 > &rhs) |
Determines if memory from another allocator can be deallocated from this one. More... | |
template<typename T , typename P , typename Tr , typename OtherAllocator > | |
bool | operator!= (const allocator< T, P, Tr > &lhs, const OtherAllocator &rhs) |
Determines if memory from another allocator can be deallocated from this one. More... | |
template<typename T , typename T2 > | |
bool | operator== (standard_alloc_policy< T > const &, standard_alloc_policy< T2 > const &) |
Determines if memory from another allocator can be deallocated from this one. More... | |
template<typename T , typename OtherAllocator > | |
bool | operator== (standard_alloc_policy< T > const &, OtherAllocator const &) |
Determines if memory from another allocator can be deallocated from this one. More... | |
(EXPERIMENTAL) Encapsulates the information about the persistent memory allocation model using PMDK's libpmemobj.
This information includes the knowledge of the pointer type, their difference type, the type of the size of objects in this allocation model as well as memory allocation and deallocation primitives.
|
inlineinherited |
Allocate storage for cnt objects of type T.
Does not construct the objects.
[in] | cnt | the number of objects to allocate memory for. |
transaction_scope_error | if called outside of an active transaction. |
transaction_out_of_memory | if there is no free memory of requested size. |
transaction_alloc_error | on transactional allocation failure. |
|
inlineinherited |
Create an object at a specific address.
This should be called only within a transaction.
[in] | p | the pointer to where the object will be constructed. |
[in] | args | parameters passed to the object's constructor. |
transaction_scope_error | if called outside of an active transaction. |
rethrows | exception from T constructor. |
|
inlineinherited |
Create an object at a specific address.
This should be called only within a transaction.
[in] | p | the pointer to where the object will be constructed. |
[in] | t | the object reference for copy construction. |
transaction_scope_error | if called outside of an active transaction. |
rethrows | exception from T constructor. |
|
inlineinherited |
Deallocates storage pointed to p, which must be a value returned by a previous call to allocate that has not been invalidated by an intervening call to deallocate.
[in] | p | pointer to the memory to be deallocated. |
transaction_scope_error | if called outside of an active transaction. |
transaction_free_error | on transactional free failure. |
|
inlineinherited |
Destroy an object based on a pointer.
This should be called only within a transaction.
[in] | p | the pointer to the object to be destroyed. |
|
inlineinherited |
The largest value that can meaningfully be passed to allocate().
|
related |
Determines if memory from another allocator can be deallocated from this one.
[in] | lhs | left hand side allocator. |
[in] | rhs | right hand side allocator. |
|
related |
Determines if memory from another allocator can be deallocated from this one.
[in] | lhs | left hand side allocator. |
[in] | rhs | right hand side allocator. |
|
related |
Determines if memory from another allocator can be deallocated from this one.
|
related |
Determines if memory from another allocator can be deallocated from this one.