Dune Core Modules (2.4.2)
Allocators
Implementations of the STL allocator concept. More...
Classes | |
class | Dune::DebugAllocator< T > |
Allocators implementation which performs different kind of memory checks. More... | |
class | Dune::MallocAllocator< T > |
Allocators implementation which simply calls malloc/free. More... | |
class | Dune::Pool< T, s > |
A memory pool of objects. More... | |
class | Dune::PoolAllocator< T, s > |
An allocator managing a pool of objects for reuse. More... | |
Functions | |
Dune::Pool< T, s >::Pool () | |
Constructor. | |
Dune::Pool< T, s >::~Pool () | |
Destructor. | |
void | Dune::Pool< T, s >::print (std::ostream &os) |
Print elements in pool for debugging. | |
void | Dune::Pool< T, s >::free (void *o) |
Free an object. More... | |
void * | Dune::Pool< T, s >::allocate () |
Get a new or recycled object. More... | |
Dune::PoolAllocator< T, s >::PoolAllocator () | |
Constructor. | |
pointer | Dune::PoolAllocator< T, s >::allocate (std::size_t n, const_pointer hint=0) |
Allocates objects. More... | |
void | Dune::PoolAllocator< T, s >::deallocate (pointer p, std::size_t n) |
Free objects. More... | |
void | Dune::PoolAllocator< T, s >::construct (pointer p, const_reference value) |
Construct an object. More... | |
void | Dune::PoolAllocator< T, s >::destroy (pointer p) |
Destroy an object without freeing memory. More... | |
Detailed Description
Implementations of the STL allocator concept.
Function Documentation
◆ allocate() [1/2]
template<class T , std::size_t S>
|
inline |
Get a new or recycled object.
- Returns
- A pointer to the object memory.
◆ allocate() [2/2]
template<class T , std::size_t s>
|
inline |
Allocates objects.
- Parameters
-
n The number of objects to allocate. Has to be one! hint Ignored hint.
- Returns
- A pointer tp the allocated elements.
◆ construct()
template<class T , std::size_t s>
|
inline |
Construct an object.
- Parameters
-
p Pointer to the object. value The value to initialize it to.
◆ deallocate()
template<class T , std::size_t s>
|
inline |
Free objects.
Does not call the destructor!
- Parameters
-
n The number of objects to free. Has to be one! p Pointer to the first object.
◆ destroy()
template<class T , std::size_t s>
|
inline |
Destroy an object without freeing memory.
- Parameters
-
p Pointer to the object.
◆ free()
template<class T , std::size_t S>
|
inline |
Free an object.
- Parameters
-
o The pointer to memory block of the object.
|
Legal Statements / Impressum |
Hosted by TU Dresden |
generated with Hugo v0.111.3
(Dec 20, 23:31, 2024)