Commit 2073e3ec authored by Simon Marlow's avatar Simon Marlow

Don't clearNurseries() in parallel with -debug

It makes sanity-checking fail.
parent 232f1a27
......@@ -306,6 +306,12 @@ TICK_VAR(2)
#define DEBUG_ONLY(s) doNothing()
#endif
#ifdef DEBUG
#define DEBUG_IS_ON 1
#else
#define DEBUG_IS_ON 0
#endif
/* -----------------------------------------------------------------------------
Useful macros and inline functions
-------------------------------------------------------------------------- */
......
......@@ -404,7 +404,7 @@ GarbageCollect (nat collect_gen,
break;
}
if (n_gc_threads != 1) {
if (!DEBUG_IS_ON && n_gc_threads != 1) {
gct->allocated = clearNursery(cap);
}
......@@ -638,7 +638,7 @@ GarbageCollect (nat collect_gen,
}
// Reset the nursery: make the blocks empty
if (n_gc_threads == 1) {
if (DEBUG_IS_ON || n_gc_threads == 1) {
for (n = 0; n < n_capabilities; n++) {
allocated += clearNursery(&capabilities[n]);
}
......@@ -1074,7 +1074,9 @@ gcWorkerThread (Capability *cap)
scavenge_until_all_done();
gct->allocated = clearNursery(cap);
if (!DEBUG_IS_ON) {
gct->allocated = clearNursery(cap);
}
#ifdef THREADED_RTS
// Now that the whole heap is marked, we discard any sparks that
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment