NGSolve  4.9
Public Member Functions
ngstd::LocalHeap Class Reference

Optimized memory handler. More...

#include <localheap.hpp>

Inheritance diagram for ngstd::LocalHeap:
ngstd::LocalHeapMem< S >

List of all members.

Public Member Functions

NGS_DLL_HEADER LocalHeap (size_t asize, const char *aname)
 Allocate one block of size asize.
 LocalHeap (char *adata, size_t asize, const char *aname) throw ()
 Use provided memory for the LocalHeap.
 LocalHeap (const LocalHeap &lh2)
 Use provided memory for the LocalHeap.
 ~LocalHeap ()
 free memory
void CleanUp () throw ()
 delete all memory on local heap
void * GetPointer () throw ()
 returns heap-pointer
void CleanUp (void *addr) throw ()
 deletes memory back to heap-pointer
void * Alloc (size_t size) throw (LocalHeapOverflow)
 allocates size bytes of memory from local heap
template<typename T >
T * Alloc (size_t size) throw (LocalHeapOverflow)
 allocates size objects of type T on local heap
void Free (void *data) throw ()
 free memory (dummy function)
size_t Available () const throw ()
 available memory on LocalHeap
LocalHeap Split () const
 Split free memory on heap into pieces for each openmp-thread.

Detailed Description

Optimized memory handler.

One block of data is organized as stack memory. One can allocate memory out of it. This increases the stack pointer. With {CleanUp}, the pointer is reset to the beginning or to a specific position.


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