/* -----------------------------------------------------------------------------
- * $Id: GCCompact.c,v 1.8 2001/08/10 09:40:11 simonmar Exp $
+ * $Id: GCCompact.c,v 1.12 2002/03/12 11:51:06 simonmar Exp $
*
* (c) The GHC Team 2001
*
*
* ---------------------------------------------------------------------------*/
+#include "PosixSource.h"
#include "Rts.h"
#include "RtsUtils.h"
#include "RtsFlags.h"
update_fwd_compact( bdescr *blocks )
{
StgPtr p, q, free;
+#if 0
StgWord m;
+#endif
bdescr *bd, *free_bd;
StgInfoTable *info;
nat size;
update_bkwd_compact( step *stp )
{
StgPtr p, free;
+#if 0
StgWord m;
+#endif
bdescr *bd, *free_bd;
StgInfoTable *info;
nat size, free_blocks;
{
nat g, s, blocks;
step *stp;
- extern StgWeak *old_weak_ptr_list; // tmp
// 1. thread the roots
get_roots((evac_fn)thread);
// the global thread list
thread((StgPtr)&all_threads);
+ // any threads resurrected during this GC
+ thread((StgPtr)&resurrected_threads);
+
+ // the main threads list
+ {
+ StgMainThread *m;
+ for (m = main_threads; m != NULL; m = m->link) {
+ thread((StgPtr)&m->tso);
+ }
+ }
+
// the static objects
thread_static(scavenged_static_objects);
// the stable pointer table
threadStablePtrTable((evac_fn)thread);
+ // the CAF list (used by GHCi)
+ markCAFs((evac_fn)thread);
+
// 2. update forward ptrs
for (g = 0; g < RtsFlags.GcFlags.generations; g++) {
for (s = 0; s < generations[g].n_steps; s++) {