diff --git a/io/io/inc/TMapFile.h b/io/io/inc/TMapFile.h index 48bd9afdeaccba21ea8ef02ea6b4a11cdc11cb96..1cd5352d60299fe452cd6ab5496f0b82b5ba5d6c 100644 --- a/io/io/inc/TMapFile.h +++ b/io/io/inc/TMapFile.h @@ -21,10 +21,6 @@ #ifndef ROOT_TROOT #include "TROOT.h" #endif -#if !defined(__MMPRIVATE_H) && !defined(__CINT__) -#include "mmprivate.h" -#endif - class TBrowser; class TDirectory; @@ -159,34 +155,6 @@ public: TMapRec *GetNext(Long_t offset = 0) const { return (TMapRec *)((Long_t) fNext + offset); } }; -//////////////////////////////////////////////////////////////////////////////// -/// Return the current location in the memory region for this malloc heap which -/// represents the end of memory in use. Returns 0 if map file was closed. - -inline void *TMapFile::GetBreakval() const -{ - if (!fMmallocDesc) return 0; - return (void *)((struct mdesc *)fMmallocDesc)->breakval; -} - -//////////////////////////////////////////////////////////////////////////////// - -inline TMapFile *TMapFile::WhichMapFile(void *addr) -{ - if (!gROOT || !gROOT->GetListOfMappedFiles()) return 0; - - TObjLink *lnk = ((TList *)gROOT->GetListOfMappedFiles())->LastLink(); - while (lnk) { - TMapFile *mf = (TMapFile*)lnk->GetObject(); - if (!mf) return 0; - if ((ULong_t)addr >= mf->fBaseAddr + mf->fOffset && - (ULong_t)addr < (ULong_t)mf->GetBreakval() + mf->fOffset) - return mf; - lnk = lnk->Prev(); - } - return 0; -} - R__EXTERN void *gMmallocDesc; //is initialized in TClass.cxx #endif diff --git a/io/io/src/TMapFile.cxx b/io/io/src/TMapFile.cxx index 588279281263f3d5394a064a0fe7e85272a5fdc5..ad4c646431d7a73ba95e65d7b67048eccb4724e4 100644 --- a/io/io/src/TMapFile.cxx +++ b/io/io/src/TMapFile.cxx @@ -96,6 +96,8 @@ robust Streamer mechanism I opted for 3). #include "TClass.h" #include "TBufferFile.h" #include "TVirtualMutex.h" +#include "mmprivate.h" + #include <cmath> #if defined(R__UNIX) && !defined(R__MACOSX) && !defined(R__WINGCC) @@ -1088,6 +1090,15 @@ Int_t TMapFile::GetBestBuffer() return (Int_t)(mean + std::sqrt(rms2)); } +//////////////////////////////////////////////////////////////////////////////// +/// Return the current location in the memory region for this malloc heap which +/// represents the end of memory in use. Returns 0 if map file was closed. + +void *TMapFile::GetBreakval() const +{ + if (!fMmallocDesc) return 0; + return (void *)((struct mdesc *)fMmallocDesc)->breakval; +} //////////////////////////////////////////////////////////////////////////////// /// Create a memory mapped file. @@ -1183,3 +1194,22 @@ void TMapFile::operator delete(void *ptr) TObject::operator delete(ptr); } + +//////////////////////////////////////////////////////////////////////////////// + +TMapFile *TMapFile::WhichMapFile(void *addr) +{ + if (!gROOT || !gROOT->GetListOfMappedFiles()) return 0; + + TObjLink *lnk = ((TList *)gROOT->GetListOfMappedFiles())->LastLink(); + while (lnk) { + TMapFile *mf = (TMapFile*)lnk->GetObject(); + if (!mf) return 0; + if ((ULong_t)addr >= mf->fBaseAddr + mf->fOffset && + (ULong_t)addr < (ULong_t)mf->GetBreakval() + mf->fOffset) + return mf; + lnk = lnk->Prev(); + } + return 0; +} +