From 219b3411a6101f9467e5dad019add7c54a47372c Mon Sep 17 00:00:00 2001 From: Axel Naumann <Axel.Naumann@cern.ch> Date: Sat, 8 Nov 2014 11:52:30 -0600 Subject: [PATCH] Revert "Hide implementation details of mmprivate.h." libNew depends on the inlines to avoid library dependency on libRIO. This reverts commit 18ae97923feeaa0dfa365bbf0e1818380baec59e. --- io/io/inc/TMapFile.h | 30 ++++++++++++++++++++++++++++++ io/io/src/TMapFile.cxx | 31 ------------------------------- 2 files changed, 30 insertions(+), 31 deletions(-) diff --git a/io/io/inc/TMapFile.h b/io/io/inc/TMapFile.h index 89750fb6fc8..05b4d70e83e 100644 --- a/io/io/inc/TMapFile.h +++ b/io/io/inc/TMapFile.h @@ -41,6 +41,9 @@ #ifndef ROOT_TROOT #include "TROOT.h" #endif +#if !defined(__MMPRIVATE_H) && !defined(__CINT__) +#include "mmprivate.h" +#endif class TBrowser; @@ -176,6 +179,33 @@ public: }; +//______________________________________________________________________________ +inline void *TMapFile::GetBreakval() const +{ + // 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. + + 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 4e6a1c4dc44..b3538e47623 100644 --- a/io/io/src/TMapFile.cxx +++ b/io/io/src/TMapFile.cxx @@ -98,10 +98,6 @@ #include "TVirtualMutex.h" #include <cmath> -#if !defined(__MMPRIVATE_H) -#include "mmprivate.h" -#endif - #if defined(R__UNIX) && !defined(R__MACOSX) && !defined(R__WINGCC) #define HAVE_SEMOP #include <sys/types.h> @@ -1174,30 +1170,3 @@ void TMapFile::operator delete(void *ptr) TObject::operator delete(ptr); } - -//______________________________________________________________________________ -void *TMapFile::GetBreakval() const -{ - // 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. - - if (!fMmallocDesc) return 0; - return (void *)((struct mdesc *)fMmallocDesc)->breakval; -} - -//______________________________________________________________________________ -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; -} -- GitLab