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
Don't use pass-by-value for large parameters.
[simgrid.git]
/
src
/
xbt
/
mallocator.c
diff --git
a/src/xbt/mallocator.c
b/src/xbt/mallocator.c
index
041f82c
..
3469e22
100644
(file)
--- a/
src/xbt/mallocator.c
+++ b/
src/xbt/mallocator.c
@@
-46,13
+46,13
@@
static int initialization_done = 0;
static inline void lock_reset(xbt_mallocator_t m)
{
static inline void lock_reset(xbt_mallocator_t m)
{
-
m->lock = 0
;
+
atomic_flag_clear(&m->lock)
;
}
static inline void lock_acquire(xbt_mallocator_t m)
{
if (initialization_done > 1) {
}
static inline void lock_acquire(xbt_mallocator_t m)
{
if (initialization_done > 1) {
- while (
__atomic_test_and_set(&m->lock, __ATOMIC_ACQUIRE
))
+ while (
atomic_flag_test_and_set(&m->lock
))
/* nop */;
}
}
/* nop */;
}
}
@@
-60,7
+60,7
@@
static inline void lock_acquire(xbt_mallocator_t m)
static inline void lock_release(xbt_mallocator_t m)
{
if (initialization_done > 1)
static inline void lock_release(xbt_mallocator_t m)
{
if (initialization_done > 1)
-
__atomic_clear(&m->lock, __ATOMIC_RELEASE
);
+
atomic_flag_clear(&m->lock
);
}
/**
}
/**