1 #ifndef MADNESS_WORLD_WORLDMEM_H__INCLUDED
2 #define MADNESS_WORLD_WORLDMEM_H__INCLUDED
39 #ifdef WORLD_GATHER_MEM_STATS
41 #endif // WORLD_GATHER_MEM_STATS
54 #ifdef WORLD_GATHER_MEM_STATS
55 friend void* ::operator
new(
size_t size)
throw (std::bad_alloc);
56 friend void ::operator
delete(
void *p)
throw();
60 void do_new(
void *p, std::size_t size);
63 void do_del(
void *p, std::size_t size);
66 static const unsigned long overhead = 4*
sizeof(long) + 16;
97 #endif // MADNESS_WORLD_WORLDMEM_H__INCLUDED
unsigned long num_new_calls
If you add new stats be sure that the initialization in worldmem.cc is OK.
Definition: worldmem.h:68
void print() const
Prints memory use statistics to std::cout.
Definition: worldmem.cc:89
unsigned long max_num_bytes
Lifetime maximum number of allocated bytes.
Definition: worldmem.h:73
void reset()
Resets all counters to zero.
Definition: worldmem.cc:103
unsigned long max_mem_limit
if size+cur_num_bytes>max_mem_limit new will throw MadnessException
Definition: worldmem.h:74
bool trace
Definition: worldmem.h:75
unsigned long cur_num_frags
Current number of allocated fragments.
Definition: worldmem.h:70
void set_trace(bool trace)
If trace is set true a message is printed for every new and delete.
Definition: worldmem.h:84
unsigned long max_num_frags
Lifetime maximum number of allocated fragments.
Definition: worldmem.h:71
unsigned long cur_num_bytes
Current amount of allocated memory in bytes.
Definition: worldmem.h:72
Used to output memory statistics and control tracing, etc.
Definition: worldmem.h:53
void set_max_mem_limit(unsigned long max_mem_limit)
Set the maximum memory limit (trying to allocate more will throw MadnessException) ...
Definition: worldmem.h:89
WorldMemInfo * world_mem_info()
Returns pointer to internal structure.
Definition: worldmem.cc:65
Holds machinery to set up Functions/FuncImpls using various Factories and Interfaces.
Definition: chem/atomutil.cc:45
static const unsigned long overhead
Definition: worldmem.h:66
unsigned long num_del_calls
Counts calls to delete.
Definition: worldmem.h:69