Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
Related Functions
:
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
v
w
x
z
Files
File List
File Members
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Variables
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Enumerations
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
v
x
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
GitLab
LXR
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
Control
CxxUtils
CxxUtils
page_access.h
Go to the documentation of this file.
1
// dear emacs, this is -*- C++ -*-
2
3
/*
4
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
5
*/
6
7
#ifndef CXXUTILS_PAGEADDRESS_H
8
#define CXXUTILS_PAGEADDRESS_H 1
9
#include <cstdio>
10
#include <sys/mman.h>
/* mprotect */
11
#define DEBUG 1
12
namespace
athena
{
13
const
void
*
page_address
(
const
void
* addr);
14
void
*
page_address
(
void
* addr);
15
void
*
next_page_address
(
void
* addr);
16
int
page_protect
(
void
* addr,
int
prot);
19
template
<
typename
T>
20
size_t
page_protect
(T* addr,
int
prot) {
21
void
* pageAddr(
page_address
((
void
*)addr));
22
size_t
lProtected((
long
)addr-(
long
)pageAddr+
sizeof
(T));
23
int
rc=mprotect(pageAddr, lProtected, prot);
24
if
(rc) printf(
"page_protect WARNING: mprotect heap failed for address %p\n"
, (
void
*)addr);
25
#ifdef DEBUG
26
else
printf(
"page_protect DEBUG: set protection @%i for range @%lx - @%zx containing addr=%p\n"
,
27
prot,(
long
unsigned
int
)
page_address
(addr),(
long
unsigned
int
)addr+
sizeof
(T), (
void
*)addr);
28
#endif
29
return
(rc == 0 ? lProtected : 0);
30
}
31
}
32
#endif
athena::page_protect
int page_protect(void *addr, int prot)
Definition:
page_access.cxx:21
athena
Definition:
athena.py:1
athena::next_page_address
void * next_page_address(void *addr)
Definition:
page_access.cxx:17
athena::page_address
const void * page_address(const void *addr)
Definition:
page_access.cxx:11
Generated on Sat Apr 19 2025 21:16:27 for ATLAS Offline Software by
1.8.18