summaryrefslogtreecommitdiff
path: root/includes/rts/NonMoving.h
diff options
context:
space:
mode:
Diffstat (limited to 'includes/rts/NonMoving.h')
-rw-r--r--includes/rts/NonMoving.h27
1 files changed, 24 insertions, 3 deletions
diff --git a/includes/rts/NonMoving.h b/includes/rts/NonMoving.h
index f64769e8a9..314c582a1e 100644
--- a/includes/rts/NonMoving.h
+++ b/includes/rts/NonMoving.h
@@ -13,10 +13,31 @@
#pragma once
+// Forward declaration for Stg.h
+struct StgClosure_;
+struct StgThunk_;
+struct Capability_;
+
/* This is called by the code generator */
extern DLL_IMPORT_RTS
-void updateRemembSetPushClosure_(StgRegTable *reg, StgClosure *p);
+void updateRemembSetPushClosure_(StgRegTable *reg, struct StgClosure_ *p);
+
+extern DLL_IMPORT_RTS
+void updateRemembSetPushThunk_(StgRegTable *reg, struct StgThunk_ *p);
+
+// Forward declaration for unregisterised backend.
+EF_(stg_copyArray_barrier);
-void updateRemembSetPushClosure(Capability *cap, StgClosure *p);
+// Note that RTS code should not condition on this directly by rather
+// use the IF_NONMOVING_WRITE_BARRIER_ENABLED macro to ensure that
+// the barrier is eliminated in the non-threaded RTS.
+extern StgWord DLL_IMPORT_DATA_VAR(nonmoving_write_barrier_enabled);
-void updateRemembSetPushThunk_(StgRegTable *reg, StgThunk *p);
+// A similar macro is defined in includes/Cmm.h for C-- code.
+#if defined(THREADED_RTS)
+#define IF_NONMOVING_WRITE_BARRIER_ENABLED \
+ if (RTS_UNLIKELY(nonmoving_write_barrier_enabled))
+#else
+#define IF_NONMOVING_WRITE_BARRIER_ENABLED \
+ if (0)
+#endif