Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
Root
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
为了安全,强烈建议开启2FA双因子认证:User Settings -> Account -> Enable two-factor authentication!!!
Show more breadcrumbs
cxwx
Root
Commits
e11253d4
Commit
e11253d4
authored
8 years ago
by
Axel Naumann
Browse files
Options
Downloads
Patches
Plain Diff
Outline functions to remove mmalloc from interface; not perf critical.
parent
69257729
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
io/io/inc/TMapFile.h
+0
-32
0 additions, 32 deletions
io/io/inc/TMapFile.h
io/io/src/TMapFile.cxx
+30
-0
30 additions, 0 deletions
io/io/src/TMapFile.cxx
with
30 additions
and
32 deletions
io/io/inc/TMapFile.h
+
0
−
32
View file @
e11253d4
...
@@ -21,10 +21,6 @@
...
@@ -21,10 +21,6 @@
#ifndef ROOT_TROOT
#ifndef ROOT_TROOT
#include
"TROOT.h"
#include
"TROOT.h"
#endif
#endif
#if !defined(__MMPRIVATE_H) && !defined(__CINT__)
#include
"mmprivate.h"
#endif
class
TBrowser
;
class
TBrowser
;
class
TDirectory
;
class
TDirectory
;
...
@@ -159,34 +155,6 @@ public:
...
@@ -159,34 +155,6 @@ public:
TMapRec
*
GetNext
(
Long_t
offset
=
0
)
const
{
return
(
TMapRec
*
)((
Long_t
)
fNext
+
offset
);
}
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
R__EXTERN
void
*
gMmallocDesc
;
//is initialized in TClass.cxx
#endif
#endif
This diff is collapsed.
Click to expand it.
io/io/src/TMapFile.cxx
+
30
−
0
View file @
e11253d4
...
@@ -96,6 +96,8 @@ robust Streamer mechanism I opted for 3).
...
@@ -96,6 +96,8 @@ robust Streamer mechanism I opted for 3).
#include
"TClass.h"
#include
"TClass.h"
#include
"TBufferFile.h"
#include
"TBufferFile.h"
#include
"TVirtualMutex.h"
#include
"TVirtualMutex.h"
#include
"mmprivate.h"
#include
<cmath>
#include
<cmath>
#if defined(R__UNIX) && !defined(R__MACOSX) && !defined(R__WINGCC)
#if defined(R__UNIX) && !defined(R__MACOSX) && !defined(R__WINGCC)
...
@@ -1088,6 +1090,15 @@ Int_t TMapFile::GetBestBuffer()
...
@@ -1088,6 +1090,15 @@ Int_t TMapFile::GetBestBuffer()
return
(
Int_t
)(
mean
+
std
::
sqrt
(
rms2
));
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.
/// Create a memory mapped file.
...
@@ -1183,3 +1194,22 @@ void TMapFile::operator delete(void *ptr)
...
@@ -1183,3 +1194,22 @@ void TMapFile::operator delete(void *ptr)
TObject
::
operator
delete
(
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
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment