diff options
author | Ben Gamari <ben@smart-cactus.org> | 2019-10-21 23:21:01 +0000 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2019-10-22 12:13:36 -0400 |
commit | 06d51c4ef776ee1bf66e3603b4c6e4e2acf8ba3c (patch) | |
tree | dec20251f027a9aba915f706c077c20c6fe5b062 /includes/rts | |
parent | 17e5a032a66bc043b453727706d4fa95a7951202 (diff) | |
download | haskell-wip/gc/nonmoving-concurrent.tar.gz |
Fix unregisterised buildwip/gc/nonmoving-concurrent
This required some fiddling around with the location of forward
declarations since the C sources generated by GHC's C backend only
includes Stg.h.
Diffstat (limited to 'includes/rts')
-rw-r--r-- | includes/rts/NonMoving.h | 27 | ||||
-rw-r--r-- | includes/rts/storage/Closures.h | 2 |
2 files changed, 25 insertions, 4 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 diff --git a/includes/rts/storage/Closures.h b/includes/rts/storage/Closures.h index 6088fc8a10..b2b5eda407 100644 --- a/includes/rts/storage/Closures.h +++ b/includes/rts/storage/Closures.h @@ -94,7 +94,7 @@ typedef struct StgClosure_ { struct StgClosure_ *payload[]; } *StgClosurePtr; // StgClosure defined in rts/Types.h -typedef struct { +typedef struct StgThunk_ { StgThunkHeader header; struct StgClosure_ *payload[]; } StgThunk; |