pmem::obj::standard_alloc_policy< void > Class Template Reference

Void specialization of the standard allocation policy. More...

`#include <libpmemobj++/allocator.hpp>`

## Classes

struct | rebind
| Rebind to a different type. More...

## Public Member Functions

| standard_alloc_policy ()=default
| Defaulted constructor.
| ~standard_alloc_policy ()=default
| Defaulted destructor.
| standard_alloc_policy (standard_alloc_policy const &)
| Explicit copy constructor.
template<typename U >
| standard_alloc_policy (standard_alloc_policy< U > const &)
| Type converting constructor.
pointer | allocate (size_type cnt, const_pointer=0)
| Allocate storage for cnt bytes. 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...

## Detailed Description

### template<>
class pmem::obj::standard_alloc_policy< void >

Void specialization of the standard allocation policy.

## Member Function Documentation

## allocate()

pointer pmem::obj::standard_alloc_policy< void >::allocate | ( | size_type | cnt,
|  | const_pointer | = `0`
| ) |  |

inline

Allocate storage for cnt bytes.

Assumes sizeof(void) = 1.

Parameters

  [in] | cnt | the number of bytes to be allocated.

Exceptions

  transaction_scope_error | if called outside of a transaction.

## deallocate()

void pmem::obj::standard_alloc_policy< void >::deallocate | ( | pointer | p,
|  | size_type | = `0`
| ) |  |

inline

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.

Parameters

  [in] | p | pointer to the memory to be deallocated.

## max_size()

size_type pmem::obj::standard_alloc_policy< void >::max_size | ( |  | ) | const

inline

The largest value that can meaningfully be passed to allocate().

Returns
  largest value that can be passed to allocate.

The documentation for this class was generated from the following file:

- pmdk-1.4.1/src/include/libpmemobj++/allocator.hpp