/* Find out where we're going, using the handy "to" pointer in
* the step of the source object. If it turns out we need to
/* Find out where we're going, using the handy "to" pointer in
* the step of the source object. If it turns out we need to
- bd = ws->todo_bd;
- to = bd->free;
- if (to + size >= bd->start + BLOCK_SIZE_W) {
- bd = gc_alloc_todo_block(ws);
- to = bd->free;
+
+ ASSERT(ws->todo_free >= ws->todo_bd->free && ws->todo_free <= ws->todo_lim);
+ to = ws->todo_free;
+ if (to + size >= ws->todo_lim) {
+ to = gc_alloc_todo_block(ws);
/* -----------------------------------------------------------------------------
The evacuate() code
-------------------------------------------------------------------------- */
/* -----------------------------------------------------------------------------
The evacuate() code
-------------------------------------------------------------------------- */
prev = (StgSelector*)((StgClosure *)p)->payload[0];
// Update the THUNK_SELECTOR with an indirection to the
prev = (StgSelector*)((StgClosure *)p)->payload[0];
// Update the THUNK_SELECTOR with an indirection to the
// We didn't manage to evaluate this thunk; restore the old info
// pointer. But don't forget: we still need to evacuate the thunk itself.
SET_INFO(p, (const StgInfoTable *)info_ptr);
// We didn't manage to evaluate this thunk; restore the old info
// pointer. But don't forget: we still need to evacuate the thunk itself.
SET_INFO(p, (const StgInfoTable *)info_ptr);
- copy(&val,(StgClosure *)p,THUNK_SELECTOR_sizeW(),bd->step->to);
- } else {
- val = (StgClosure *)p;
+ copy(q,(StgClosure *)p,THUNK_SELECTOR_sizeW(),bd->step->to);