diff options
author | Ben Gamari <ben@smart-cactus.org> | 2022-10-22 21:41:42 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2023-03-08 15:02:30 -0500 |
commit | d4032690a8bf638f6d134cc6592d138eb018f102 (patch) | |
tree | 2f7a6a44608a52d19b11cdbd62ebc97f3b10818d /rts | |
parent | 1b06967176559d6b2b530dd16e127fa4479ae47f (diff) | |
download | haskell-d4032690a8bf638f6d134cc6592d138eb018f102.tar.gz |
nonmoving: Post-sweep sanity checking
Diffstat (limited to 'rts')
-rw-r--r-- | rts/sm/NonMoving.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/rts/sm/NonMoving.c b/rts/sm/NonMoving.c index 3326dc69c5..4cb3eebca0 100644 --- a/rts/sm/NonMoving.c +++ b/rts/sm/NonMoving.c @@ -25,8 +25,11 @@ #include "NonMovingSweep.h" #include "NonMovingCensus.h" #include "StablePtr.h" // markStablePtrTable +#include "Sanity.h" #include "Weak.h" // scheduleFinalizers +//#define NONCONCURRENT_SWEEP + struct NonmovingHeap nonmovingHeap; uint8_t nonmovingMarkEpoch = 1; @@ -1191,7 +1194,7 @@ static void nonmovingMark_(MarkQueue *mark_queue, StgWeak **dead_weaks, StgTSO * #endif // Everything has been marked; allow the mutators to proceed -#if defined(THREADED_RTS) +#if defined(THREADED_RTS) && !defined(NONCONCURRENT_SWEEP) nonmoving_write_barrier_enabled = false; nonmovingFinishFlush(task); #endif @@ -1230,6 +1233,15 @@ static void nonmovingMark_(MarkQueue *mark_queue, StgWeak **dead_weaks, StgTSO * nonmovingTraceAllocatorCensus(); #endif +#if defined(THREADED_RTS) && defined(NONCONCURRENT_SWEEP) +#if defined(DEBUG) + checkNonmovingHeap(&nonmovingHeap); + checkSanity(true, true); +#endif + nonmoving_write_barrier_enabled = false; + nonmovingFinishFlush(task); +#endif + // TODO: Remainder of things done by GarbageCollect (update stats) #if defined(THREADED_RTS) |