Simpatico
v1.10
|
Provides method to allocate array.
The Memory::allocate() method invokes the new operator within a try catch block, and keeps track of the total memory allocated.
#include <Memory.h>
Static Public Member Functions | |
template<typename Data > | |
static void | allocate (Data *&ptr, size_t size) |
Allocate a C array. More... | |
template<typename Data > | |
static void | deallocate (Data *&ptr, size_t size) |
Allocate a C array. More... | |
static int | nAllocate () |
Return number of times allocated was called. More... | |
static int | nDeallocate () |
Return number of times deallocate was called. More... | |
static int | total () |
Return total amount of memory currently allocated. More... | |
static int | max () |
Return the maximum amount of allocated heap memory thus far. More... | |
static int | max (MPI::Intracomm &communicator) |
Return max for any processor in communicator. More... | |
static void | initStatic () |
Call this just to guarantee initialization of static memory. More... | |
|
static |
Allocate a C array.
Allocates a Data array of size elements, assigns ptr the address of the first element.
Definition at line 104 of file Memory.h.
References UTIL_THROW.
Referenced by Util::DArray< Data >::DArray().
|
static |
Allocate a C array.
Allocates a Data array of size elements, assigns ptr the address of the first element.
Definition at line 124 of file Memory.h.
References UTIL_THROW.
Referenced by Util::GPArray< Data >::~GPArray(), and Util::GStack< Data >::~GStack().
|
static |
Return number of times allocated was called.
Definition at line 34 of file Memory.cpp.
|
static |
Return number of times deallocate was called.
Definition at line 40 of file Memory.cpp.
|
static |
Return total amount of memory currently allocated.
Definition at line 46 of file Memory.cpp.
|
static |
Return the maximum amount of allocated heap memory thus far.
This function returns the temporal maximum of total().
Definition at line 52 of file Memory.cpp.
Referenced by DdMd::Simulation::readCommands().
|
static |
Return max for any processor in communicator.
Definition at line 56 of file Memory.cpp.
|
static |
Call this just to guarantee initialization of static memory.
Definition at line 28 of file Memory.cpp.
Referenced by Util::initStatic().