summaryrefslogtreecommitdiff
path: root/rts/STM.c
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2019-04-17 18:48:38 -0400
committerBen Gamari <ben@smart-cactus.org>2019-04-17 19:50:30 -0400
commit90e0ece0f88d13cf703cc2831f7f9b772b81b4ed (patch)
treec8e4ce4e2021bc535dffbd20ae1393bd2fe71b60 /rts/STM.c
parent45662404780b4968b5308ad969e233ffeb175c9a (diff)
downloadhaskell-wip/gc/ben.tar.gz
Remove redundant write barrier checks and fix predictionwip/gc/ben
Diffstat (limited to 'rts/STM.c')
-rw-r--r--rts/STM.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/rts/STM.c b/rts/STM.c
index 9176f66e72..c17f33aaa0 100644
--- a/rts/STM.c
+++ b/rts/STM.c
@@ -297,7 +297,7 @@ static StgClosure *lock_tvar(Capability *cap,
} while (cas((void *)&(s -> current_value),
(StgWord)result, (StgWord)trec) != (StgWord)result);
- if (nonmoving_write_barrier_enabled && result) {
+ if (RTS_UNLIKELY(nonmoving_write_barrier_enabled && result)) {
updateRemembSetPushClosure(cap, result);
}
return result;
@@ -323,7 +323,7 @@ static StgBool cond_lock_tvar(Capability *cap,
TRACE("%p : cond_lock_tvar(%p, %p)", trec, s, expected);
w = cas((void *)&(s -> current_value), (StgWord)expected, (StgWord)trec);
result = (StgClosure *)w;
- if (nonmoving_write_barrier_enabled && result) {
+ if (RTS_UNLIKELY(nonmoving_write_barrier_enabled && result)) {
updateRemembSetPushClosure(cap, expected);
}
TRACE("%p : %s", trec, result ? "success" : "failure");