A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
inline 2 more VM functions, and kill a simcall
[simgrid.git]
/
src
/
xbt
/
mmalloc
/
mmorecore.c
diff --git
a/src/xbt/mmalloc/mmorecore.c
b/src/xbt/mmalloc/mmorecore.c
index 5227d08d201d0e6aa645cad2623b4ec7b9842024..e876dd2ba582c2e5c126a67c1af03bd93022a6a6 100644
(file)
--- a/
src/xbt/mmalloc/mmorecore.c
+++ b/
src/xbt/mmalloc/mmorecore.c
@@
-45,6
+45,11
@@
? -1 \
: (MDP) -> fd)
? -1 \
: (MDP) -> fd)
+/* Return 0if MDP uses anonymous mapping. Otherwise, return off */
+#define MAP_ANON_OR_OFFSET(MDP, off) (((MDP) -> flags & MMALLOC_ANONYMOUS) \
+ ? 0 \
+ : off)
+
/** @brief Add memoty to this heap
*
* Get core for the memory region specified by MDP, using SIZE as the
/** @brief Add memoty to this heap
*
* Get core for the memory region specified by MDP, using SIZE as the
@@
-119,7
+124,7
@@
void *mmorecore(struct mdesc *mdp, ssize_t size)
*/
mapto = mmap(mdp->top, mapbytes, PROT_READ | PROT_WRITE,
MAP_PRIVATE_OR_SHARED(mdp) | MAP_IS_ANONYMOUS(mdp) |
*/
mapto = mmap(mdp->top, mapbytes, PROT_READ | PROT_WRITE,
MAP_PRIVATE_OR_SHARED(mdp) | MAP_IS_ANONYMOUS(mdp) |
- MAP_FIXED, MAP_ANON_OR_FD(mdp),
foffset
);
+ MAP_FIXED, MAP_ANON_OR_FD(mdp),
MAP_ANON_OR_OFFSET(mdp, foffset)
);
if (mapto == MAP_FAILED) {
char buff[1024];
if (mapto == MAP_FAILED) {
char buff[1024];