11 #ifndef ROOT_TMemStatMng
12 #define ROOT_TMemStatMng
20 #ifndef ROOT_TTimeStamp
24 #ifndef ROOT_TMemStatHook
27 #ifndef ROOT_TMemStatDef
64 memset(
fValue, 0, g_digestSize);
67 memcpy(
fValue, _val, g_digestSize);
83 typedef std::map<SCustomDigest, Int_t>
CRCSet_t;
104 #if !defined(__APPLE__)
111 static void *
AllocHook(
size_t size,
const void* );
112 static void FreeHook(
void* ptr,
const void* );
116 void **stackPointers);
void SetMaxCalls(Int_t maxcalls)
Set the maximum number of new/delete registered in the output Tree.
bool add(ULong_t addr, Int_t idx)
void Enable()
Enable memory hooks.
void FillTree()
loop on all entries in the buffer and fill the output Tree entries with alloc and free in the buffer ...
void SetUseGNUBuiltinBacktrace(Bool_t newVal)
static void Close()
Close - a static function This method stops the manager, flashes all the buffered data and closes the...
static void * AllocHook(size_t size, const void *)
AllocHook - a static function A glibc memory allocation hook.
const UShort_t g_digestSize
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
void Init()
old free function
SCustomDigest(UChar_t _val[g_digestSize])
static void MacAllocHook(void *ptr, size_t size)
AllocHook - a static function a special memory hook for Mac OS X memory zones.
UChar_t fValue[g_digestSize]
Container_t::value_type value_type
#define ClassDef(name, id)
The TNamed class is the base class for all named ROOT classes.
bool operator<(const SCustomDigest &a, const SCustomDigest &b)
std::map< std::string, std::string >::const_iterator iter
TTree * fDumpTree
file to dump current information
void *(* MallocHookFunc_t)(size_t size, const void *caller)
virtual ~TMemStatMng()
if an instance is destructed - the hooks are reseted to old hooks
Bool_t fUseGNUBuiltinBacktrace
static void MacFreeHook(void *ptr)
AllocHook - a static function a special memory hook for Mac OS X memory zones.
1-D histogram with a int per channel (see TH1 documentation)}
void AddPointer(void *ptr, Int_t size)
Add pointer to table.
void Disable()
Disble memory hooks.
static TMemStatMng * fgInstance
tree to dump information
void(* FreeHookFunc_t)(void *ptr, const void *caller)
unsigned long long ULong64_t
std::map< SCustomDigest, Int_t > CRCSet_t
The TTimeStamp encapsulates seconds and ns since EPOCH.
void SetBufferSize(Int_t buffersize)
Set the maximum number of alloc/free calls to be buffered.
TMemStatHook::MallocHookFunc_t fPreviousMallocHook
Container_t::iterator pos_type
Mother of all ROOT objects.
Int_t generateBTID(UChar_t *CRCdigest, Int_t stackEntries, void **stackPointers)
An internal function, which returns a bitid for a corresponding CRC digest cache variables.
static void FreeHook(void *ptr, const void *)
FreeHook - a static function A glibc memory deallocation hook.
A TTree object has a header with a name and a title.
static TMemStatMng * GetInstance()
GetInstance - a static function Initialize a singleton of MemStat manager.
TMemStatHook::FreeHookFunc_t fPreviousFreeHook
old malloc function
TMemStatFAddrContainer fFAddrs
std::map< ULong_t, Int_t > Container_t