X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;ds=sidebyside;f=ghc%2Frts%2FGCCompact.c;h=58753feed4b0d60bf0685480f5f86c55d600d956;hb=fff682f4cd3e29aa423720512977d63e2a4e3bc4;hp=549a27c50a486f718e3091ca843d698c12663bf5;hpb=522e46fd040f48bf9414254f2e2a1520aaa257ad;p=ghc-hetmet.git diff --git a/ghc/rts/GCCompact.c b/ghc/rts/GCCompact.c index 549a27c..58753fe 100644 --- a/ghc/rts/GCCompact.c +++ b/ghc/rts/GCCompact.c @@ -688,9 +688,6 @@ thread_obj (StgInfoTable *info, StgPtr p) StgTVar *tvar = (StgTVar *)p; thread((StgPtr)&tvar->current_value); thread((StgPtr)&tvar->first_wait_queue_entry); -#if defined(SMP) - thread((StgPtr)&tvar->last_update_by); -#endif return p + sizeofW(StgTVar); } @@ -842,7 +839,7 @@ update_bkwd_compact( step *stp ) StgInfoTable *info; nat size, free_blocks; - bd = free_bd = stp->blocks; + bd = free_bd = stp->old_blocks; free = free_bd->start; free_blocks = 1; @@ -917,7 +914,6 @@ update_bkwd_compact( step *stp ) freeChain(free_bd->link); free_bd->link = NULL; } - stp->n_blocks = free_blocks; return free_blocks; } @@ -933,10 +929,10 @@ compact( void (*get_roots)(evac_fn) ) // the weak pointer lists... if (weak_ptr_list != NULL) { - thread((StgPtr)&weak_ptr_list); + thread((StgPtr)(void *)&weak_ptr_list); } if (old_weak_ptr_list != NULL) { - thread((StgPtr)&old_weak_ptr_list); // tmp + thread((StgPtr)(void *)&old_weak_ptr_list); // tmp } // mutable lists @@ -951,16 +947,18 @@ compact( void (*get_roots)(evac_fn) ) } // the global thread list - thread((StgPtr)&all_threads); + thread((StgPtr)(void *)&all_threads); // any threads resurrected during this GC - thread((StgPtr)&resurrected_threads); + thread((StgPtr)(void *)&resurrected_threads); - // the main threads list + // the task list { - StgMainThread *m; - for (m = main_threads; m != NULL; m = m->link) { - thread((StgPtr)&m->tso); + Task *task; + for (task = all_tasks; task != NULL; task = task->all_link) { + if (task->tso) { + thread((StgPtr)&task->tso); + } } } @@ -976,25 +974,26 @@ compact( void (*get_roots)(evac_fn) ) // 2. update forward ptrs for (g = 0; g < RtsFlags.GcFlags.generations; g++) { for (s = 0; s < generations[g].n_steps; s++) { + if (g==0 && s ==0) continue; stp = &generations[g].steps[s]; IF_DEBUG(gc, debugBelch("update_fwd: %d.%d\n", stp->gen->no, stp->no);); - update_fwd(stp->to_blocks); + update_fwd(stp->blocks); update_fwd_large(stp->scavenged_large_objects); - if (g == RtsFlags.GcFlags.generations-1 && stp->blocks != NULL) { + if (g == RtsFlags.GcFlags.generations-1 && stp->old_blocks != NULL) { IF_DEBUG(gc, debugBelch("update_fwd: %d.%d (compact)\n", stp->gen->no, stp->no);); - update_fwd_compact(stp->blocks); + update_fwd_compact(stp->old_blocks); } } } // 3. update backward ptrs stp = &oldest_gen->steps[0]; - if (stp->blocks != NULL) { + if (stp->old_blocks != NULL) { blocks = update_bkwd_compact(stp); IF_DEBUG(gc, debugBelch("update_bkwd: %d.%d (compact, old: %d blocks, now %d blocks)\n", stp->gen->no, stp->no, - stp->n_blocks, blocks);); - stp->n_blocks = blocks; + stp->n_old_blocks, blocks);); + stp->n_old_blocks = blocks; } }