Loading...
Searching...
No Matches
Dune::MallocAllocator< T > Class Template Reference
Common » Allocators

Allocators implementation which simply calls malloc/free. More...

`#include <dune/common/mallocallocator.hh>`

Inheritance diagram for Dune::MallocAllocator< T >:

## Classes

struct | rebind

## Public Types

typedef std::size_t | size_type
typedef std::ptrdiff_t | difference_type
typedef T * | pointer
typedef const T * | const_pointer
typedef T & | reference
typedef const T & | const_reference
typedef T | value_type

## Public Member Functions

| MallocAllocator () noexcept
| create a new MallocAllocator
template<class U>
| MallocAllocator (const MallocAllocator< U > &) noexcept
| copy construct from an other MallocAllocator, possibly for a different result type
| ~MallocAllocator () noexcept
| cleanup this allocator
pointer | address (reference x) const
const_pointer | address (const_reference x) const
pointer | allocate (size_type n, const void *hint=0)
| allocate n objects of type T
void | deallocate (pointer p, size_type n)
| deallocate n objects of type T at address p
size_type | max_size () const noexcept
| max size for allocate
void | construct (pointer p, const T &val)
| copy-construct an object of type T (i.e. make a placement new on p)
template<typename ... Args>
void | construct (pointer p, Args &&... args)
| construct an object of type T from variadic parameters
void | destroy (pointer p)
| destroy an object of type T (i.e. call the destructor)

## Detailed Description

template<class T>
class Dune::MallocAllocator< T >

Allocators implementation which simply calls malloc/free.

## Member Typedef Documentation

## const_pointer

template<class T>

typedef const T* Dune::MallocAllocator< T >::const_pointer

## const_reference

template<class T>

typedef const T& Dune::MallocAllocator< T >::const_reference

## difference_type

template<class T>

typedef std::ptrdiff_t Dune::MallocAllocator< T >::difference_type

## pointer

template<class T>

typedef T* Dune::MallocAllocator< T >::pointer

## reference

template<class T>

typedef T& Dune::MallocAllocator< T >::reference

## size_type

template<class T>

typedef std::size_t Dune::MallocAllocator< T >::size_type

## value_type

template<class T>

typedef T Dune::MallocAllocator< T >::value_type

## Constructor & Destructor Documentation

## MallocAllocator() [1/2]

template<class T>

Dune::MallocAllocator< T >::MallocAllocator | ( |  | ) |

inline noexcept

create a new MallocAllocator

## MallocAllocator() [2/2]

template<class T>
template<class U>

Dune::MallocAllocator< T >::MallocAllocator | ( | const MallocAllocator< U > & |  | ) |

inline noexcept

copy construct from an other MallocAllocator, possibly for a different result type

## ~MallocAllocator()

template<class T>

Dune::MallocAllocator< T >::~MallocAllocator | ( |  | ) |

inline noexcept

cleanup this allocator

## Member Function Documentation

## address() [1/2]

template<class T>

const_pointer Dune::MallocAllocator< T >::address | ( | const_reference | x | ) | const

inline

## address() [2/2]

template<class T>

pointer Dune::MallocAllocator< T >::address | ( | reference | x | ) | const

inline

## allocate()

template<class T>

pointer Dune::MallocAllocator< T >::allocate | ( | size_type | n,
|  | const void * | hint = 0 )

inline

allocate n objects of type T

## construct() [1/2]

template<class T>
template<typename ... Args>

void Dune::MallocAllocator< T >::construct | ( | pointer | p,
|  | Args &&... | args )

inline

construct an object of type T from variadic parameters

## construct() [2/2]

template<class T>

void Dune::MallocAllocator< T >::construct | ( | pointer | p,
|  | const T & | val )

inline

copy-construct an object of type T (i.e. make a placement new on p)

## deallocate()

template<class T>

void Dune::MallocAllocator< T >::deallocate | ( | pointer | p,
|  | size_type | n )

inline

deallocate n objects of type T at address p

## destroy()

template<class T>

void Dune::MallocAllocator< T >::destroy | ( | pointer | p | ) |

inline

destroy an object of type T (i.e. call the destructor)

## max_size()

template<class T>

size_type Dune::MallocAllocator< T >::max_size | ( |  | ) | const

inline noexcept

max size for allocate

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

- mallocallocator.hh