// @(#)root/memstat:$Name$:$Id: TMemStatDepend.h 24354 2008-06-18 16:10:18Z anar $
// Author: M.Ivanov   18/06/2007 -- Anar Manafov (A.Manafov@gsi.de) 28/04/2008

/*************************************************************************
 * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/
#ifndef ROOT_TMEMSTATDEPEND
#define ROOT_TMEMSTATDEPEND

//
//  TMemStatDepend
//  Non standard C++ functions
//  Needed for memory statistic

#define _INIT_TOP_STECK extern void *g_global_stack_end;
#define _GET_TO_STECK g_global_stack_end = __builtin_frame_address(1);

class TString;

class TMemStatDepend
{
public:
   //
   // Memory managment HOOK functions
   //
   typedef void* (*MallocHookFunc_t)(size_t size, const void *caller);
   typedef void (*FreeHookFunc_t)(void* ptr, const void *caller);

   static MallocHookFunc_t GetMallocHook();         // malloc function getter
   static FreeHookFunc_t   GetFreeHook();           // free function getter
   static void SetMallocHook(MallocHookFunc_t p);   // malloc function setter
   static void SetFreeHook(FreeHookFunc_t p);       // free function setter
   //
   // Backtrace functions
   //
   static size_t Backtrace(void **trace, size_t size, Bool_t _bUseGNUBuildinBacktrace = kFALSE);
   static char** BacktraceSymbols(void **trace, size_t size);
   static void GetSymbols(void *pFunction, TString &strInfo,  TString &strLib, TString &strFun, TString &strLine);
   static void Demangle(char *codeInfo, TString &str);
};

#endif


Last change: Wed Jun 25 08:49:28 2008
Last generated: 2008-06-25 08:49

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.