| MADNESS
    version 0.9
    | 
Used to output memory statistics and control tracing, etc. More...
#include <worldmem.h>
| Public Member Functions | |
| void | print () const | 
| Prints memory use statistics to std::cout.  More... | |
| void | reset () | 
| Resets all counters to zero.  More... | |
| void | set_trace (bool trace) | 
| If trace is set true a message is printed for every new and delete.  More... | |
| void | set_max_mem_limit (unsigned long max_mem_limit) | 
| Set the maximum memory limit (trying to allocate more will throw MadnessException)  More... | |
| Public Attributes | |
| unsigned long | num_new_calls | 
| If you add new stats be sure that the initialization in worldmem.cc is OK.  More... | |
| unsigned long | num_del_calls | 
| Counts calls to delete.  More... | |
| unsigned long | cur_num_frags | 
| Current number of allocated fragments.  More... | |
| unsigned long | max_num_frags | 
| Lifetime maximum number of allocated fragments.  More... | |
| unsigned long | cur_num_bytes | 
| Current amount of allocated memory in bytes.  More... | |
| unsigned long | max_num_bytes | 
| Lifetime maximum number of allocated bytes.  More... | |
| unsigned long | max_mem_limit | 
| if size+cur_num_bytes>max_mem_limit new will throw MadnessException  More... | |
| bool | trace | 
| Static Public Attributes | |
| static const unsigned long | overhead = 4*sizeof(long) + 16 | 
Used to output memory statistics and control tracing, etc.
There is currently only one instance of this class in worldmem.cc that is used by special versions of global new+delete enabled by compliling with WORLD_GATHER_MEM_STATS enabled.
Default for max_mem_limit is unlimited.
| void madness::WorldMemInfo::print | ( | ) | const | 
Prints memory use statistics to std::cout.
References cur_num_bytes, cur_num_frags, max_num_bytes, max_num_frags, num_del_calls, num_new_calls, and overhead.
Referenced by main(), and madness::print_stats().
| void madness::WorldMemInfo::reset | ( | ) | 
Resets all counters to zero.
References cur_num_bytes, cur_num_frags, max_num_bytes, max_num_frags, num_del_calls, and num_new_calls.
| 
 | inline | 
Set the maximum memory limit (trying to allocate more will throw MadnessException)
References max_mem_limit.
| 
 | inline | 
If trace is set true a message is printed for every new and delete.
References trace.
| unsigned long madness::WorldMemInfo::cur_num_bytes | 
| unsigned long madness::WorldMemInfo::cur_num_frags | 
| unsigned long madness::WorldMemInfo::max_mem_limit | 
if size+cur_num_bytes>max_mem_limit new will throw MadnessException
Referenced by set_max_mem_limit().
| unsigned long madness::WorldMemInfo::max_num_bytes | 
| unsigned long madness::WorldMemInfo::max_num_frags | 
| unsigned long madness::WorldMemInfo::num_del_calls | 
| unsigned long madness::WorldMemInfo::num_new_calls | 
| 
 | static | 
Referenced by print().
| bool madness::WorldMemInfo::trace | 
Referenced by set_trace().
 1.8.8
 1.8.8