#ifndef ROOT_TStorage
#define ROOT_TStorage
#ifndef ROOT_Rtypes
#include "Rtypes.h"
#endif
typedef void (*FreeHookFun_t)(void*, void *addr, size_t);
typedef void *(*ReAllocFun_t)(void*, size_t);
typedef void *(*ReAllocCFun_t)(void*, size_t, size_t);
class TStorage {
private:
static ULong_t fgHeapBegin;
static ULong_t fgHeapEnd;
static size_t fgMaxBlockSize;
static FreeHookFun_t fgFreeHook;
static void *fgFreeHookData;
static ReAllocFun_t fgReAllocHook;
static ReAllocCFun_t fgReAllocCHook;
static Bool_t fgHasCustomNewDelete;
public:
virtual ~TStorage() { }
static ULong_t GetHeapBegin();
static ULong_t GetHeapEnd();
static FreeHookFun_t GetFreeHook();
static void *GetFreeHookData();
static size_t GetMaxBlockSize();
static void *Alloc(size_t size);
static void Dealloc(void *ptr);
static void *ReAlloc(void *vp, size_t size);
static void *ReAlloc(void *vp, size_t size, size_t oldsize);
static char *ReAllocChar(char *vp, size_t size, size_t oldsize);
static Int_t *ReAllocInt(Int_t *vp, size_t size, size_t oldsize);
static void *ObjectAlloc(size_t size);
static void *ObjectAlloc(size_t size, void *vp);
static void ObjectDealloc(void *vp);
static void ObjectDealloc(void *vp, void *ptr);
static void EnterStat(size_t size, void *p);
static void RemoveStat(void *p);
static void PrintStatistics();
static void SetMaxBlockSize(size_t size);
static void SetFreeHook(FreeHookFun_t func, void *data);
static void SetReAllocHooks(ReAllocFun_t func1, ReAllocCFun_t func2);
static void SetCustomNewDelete();
static void EnableStatistics(int size= -1, int ix= -1);
static Bool_t HasCustomNewDelete();
static void AddToHeap(ULong_t begin, ULong_t end);
static Bool_t IsOnHeap(void *p);
ClassDef(TStorage,0)
};
#ifndef WIN32
inline void TStorage::AddToHeap(ULong_t begin, ULong_t end)
{ if (begin < fgHeapBegin) fgHeapBegin = begin;
if (end > fgHeapEnd) fgHeapEnd = end; }
inline Bool_t TStorage::IsOnHeap(void *p)
{ return (ULong_t)p >= fgHeapBegin && (ULong_t)p < fgHeapEnd; }
inline size_t TStorage::GetMaxBlockSize() { return fgMaxBlockSize; }
inline void TStorage::SetMaxBlockSize(size_t size) { fgMaxBlockSize = size; }
inline FreeHookFun_t TStorage::GetFreeHook() { return fgFreeHook; }
#endif
#endif
Last change: Wed Jun 25 08:53:27 2008
Last generated: 2008-06-25 08:53
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.