Hex
1.0
Hydrogen-electron collision solver
|
Basic memory allocator. More...
#include <arrays.h>
Static Public Member Functions | |
static T * | alloc (size_t n) |
Allocate array. More... | |
static void | free (T *ptr) |
Free array. More... | |
Memory allocators are used by Array -like classes for memory management: allocating and freeing of memory. PlainAllocator uses the usual C++ "new/delete" mechanism for manipulation of the memory.
|
inlinestatic |
This method will allocate fields of the data type T. The elements will be constructed by the implicit constructor.
n | Number of items to allocate. |
|
inlinestatic |
This method will deallocate memory pointed to by the pointer "ptr". It is expected that pointer has been previously retrieved from the function PlainAllocator::alloc. The pointer can have the value "nullptr"; in such a case nothing will be done.