/* -----------------------------------------------------------------------------
- * $Id: GC.c,v 1.128 2001/11/26 16:54:21 simonmar Exp $
+ * $Id: GC.c,v 1.131 2002/03/07 17:53:05 keithw Exp $
*
* (c) The GHC Team 1998-1999
*
- free from-space in each step, and set from-space = to-space.
+ Locks held: sched_mutex
+
-------------------------------------------------------------------------- */
void
#ifdef PROFILING
// We call processHeapClosureForDead() on every closure destroyed during
// the current garbage collection, so we invoke LdvCensusForDead().
- if (RtsFlags.ProfFlags.doHeapProfile == HEAP_BY_LDV)
+ if (RtsFlags.ProfFlags.doHeapProfile == HEAP_BY_LDV
+ || RtsFlags.ProfFlags.bioSelector != NULL)
LdvCensusForDead(N);
#endif
// Reset the nursery
resetNurseries();
+ // let go of lock (so that it can be re-grabbed below).
+ RELEASE_LOCK(&sched_mutex);
+
// start any pending finalizers
scheduleFinalizers(old_weak_ptr_list);
// send exceptions to any threads which were about to die
resurrectThreads(resurrected_threads);
+ ACQUIRE_LOCK(&sched_mutex);
+
// Update the stable pointer hash table.
updateStablePtrTable(major_gc);
// perform the selection!
q = selectee->payload[offset];
+ if (major_gc==rtsTrue) {TICK_GC_SEL_MAJOR();} else {TICK_GC_SEL_MINOR();}
/* if we're already in to-space, there's no need to continue
* with the evacuation, just update the source address with
thunk_selector_depth--;
goto selector_loop;
}
- }
- // otherwise, fall through...
+ } else {
+ TICK_GC_SEL_ABANDONED();
+ // and fall through...
+ }
# endif
case AP_UPD: