[commit: ghc] wip/nonmoving-gc: rts: Always disable nonmoving write barrier if !THREADED (4a4251d)
git at git.haskell.org
git at git.haskell.org
Wed Feb 6 14:10:25 UTC 2019
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/nonmoving-gc
Link : http://ghc.haskell.org/trac/ghc/changeset/4a4251d90ebf525b71cc2bf4354acaf97ae902b1/ghc
>---------------------------------------------------------------
commit 4a4251d90ebf525b71cc2bf4354acaf97ae902b1
Author: Ben Gamari <ben at smart-cactus.org>
Date: Tue Feb 5 16:39:51 2019 -0500
rts: Always disable nonmoving write barrier if !THREADED
>---------------------------------------------------------------
4a4251d90ebf525b71cc2bf4354acaf97ae902b1
includes/Cmm.h | 5 +++++
rts/sm/NonMovingMark.c | 2 ++
rts/sm/NonMovingMark.h | 8 ++++++++
3 files changed, 15 insertions(+)
diff --git a/includes/Cmm.h b/includes/Cmm.h
index bee0d6d..b844020 100644
--- a/includes/Cmm.h
+++ b/includes/Cmm.h
@@ -797,6 +797,11 @@
Misc junk
-------------------------------------------------------------------------- */
+#if !defined(THREADED_RTS)
+// This is also done in rts/NonMoving.h, but that isn't visible from C--
+#define nonmoving_write_barrier_enabled 0
+#endif
+
#define NO_TREC stg_NO_TREC_closure
#define END_TSO_QUEUE stg_END_TSO_QUEUE_closure
#define STM_AWOKEN stg_STM_AWOKEN_closure
diff --git a/rts/sm/NonMovingMark.c b/rts/sm/NonMovingMark.c
index 5e67fec..9be320f 100644
--- a/rts/sm/NonMovingMark.c
+++ b/rts/sm/NonMovingMark.c
@@ -163,7 +163,9 @@ static Condition upd_rem_set_flushed_cond;
/* Indicates to mutators that the write barrier must be respected. Set while
* concurrent mark is running.
*/
+#if defined(THREADED_RTS)
bool nonmoving_write_barrier_enabled = false;
+#endif
/* Used to provide the current mark queue to the young generation
* collector for scavenging.
diff --git a/rts/sm/NonMovingMark.h b/rts/sm/NonMovingMark.h
index 2281d07..b11c4fa 100644
--- a/rts/sm/NonMovingMark.h
+++ b/rts/sm/NonMovingMark.h
@@ -114,7 +114,15 @@ extern StgIndStatic *debug_caf_list_snapshot;
extern MarkQueue *current_mark_queue;
extern bdescr *upd_rem_set_block_list;
+
+#if defined(THREADED_RTS)
extern bool nonmoving_write_barrier_enabled;
+#else
+// The write barrier is never needed if !THREADED since we don't perform
+// concurrent collection in this case.
+#define nonmoving_write_barrier_enabled 0
+#endif
+
void nonmovingMarkInitUpdRemSet(void);
void init_upd_rem_set(UpdRemSet *rset);
More information about the ghc-commits
mailing list