00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef ROOT_TMemStatDepend
00013 #define ROOT_TMemStatDepend
00014
00015 #if !defined(__CINT__)
00016 #include <sys/types.h>
00017 #endif
00018 #ifndef ROOT_Rtypes
00019 #include "Rtypes.h"
00020 #endif
00021
00022
00023
00024
00025
00026
00027 #define _INIT_TOP_STECK extern void *g_global_stack_end;
00028 #define _GET_TO_STECK g_global_stack_end = __builtin_frame_address(1);
00029
00030 class TString;
00031
00032 class TMemStatDepend
00033 {
00034 public:
00035
00036
00037
00038 typedef void* (*MallocHookFunc_t)(size_t size, const void *caller);
00039 typedef void (*FreeHookFunc_t)(void* ptr, const void *caller);
00040
00041 static MallocHookFunc_t GetMallocHook();
00042 static FreeHookFunc_t GetFreeHook();
00043 static void SetMallocHook(MallocHookFunc_t p);
00044 static void SetFreeHook(FreeHookFunc_t p);
00045
00046
00047
00048 static size_t Backtrace(void **trace, size_t size, Bool_t _bUseGNUBuildinBacktrace = kFALSE);
00049 static char** BacktraceSymbols(void **trace, size_t size);
00050 static void GetSymbols(void *pFunction, TString &strInfo, TString &strLib, TString &strFun, TString &strLine);
00051 static void Demangle(char *codeInfo, TString &str);
00052 };
00053
00054 #endif