Branch: Tag:

2001-07-01

2001-07-01 20:07:47 by Martin Stjernholm <mast@lysator.liu.se>

Fixed bug where the gc sometimes failed to mark all things referenced
from live objects properly, which causes them to be garbed too early.

Rev: src/gc.c:1.147

30:      #include "block_alloc.h"    - RCSID("$Id: gc.c,v 1.146 2001/06/11 19:58:24 mast Exp $"); + RCSID("$Id: gc.c,v 1.147 2001/07/01 20:07:47 mast Exp $");      /* Run garbage collect approximately every time    * 20 percent of all arrays, objects and programs is
1551:    }       else { -  /* Nothing more to do. Unwind the live recursion. */ +  /* We'll get here eventually in the normal recursion. Pop off +  * the remaining live recurse frames for the last thing. */    int flags; -  CYCLE_DEBUG_MSG(m, "gc_cycle_push, live rec done"); -  do { +  CYCLE_DEBUG_MSG(m, "gc_cycle_push, no live recurse");    last->flags &= ~GC_LIVE_RECURSE; - #ifdef GC_CYCLE_DEBUG -  gc_cycle_indent -= 2; -  CYCLE_DEBUG_MSG(find_marker(gc_rec_last->data), -  "> gc_cycle_push, unwinding live"); - #endif +     while (1) {    struct gc_frame *l = gc_rec_top;   #ifdef PIKE_DEBUG
1575:    }    debug_really_free_gc_frame(l);    } -  last = find_marker(gc_rec_last->data); -  } while (last->flags & GC_LIVE_RECURSE); + #ifdef GC_CYCLE_DEBUG +  gc_cycle_indent -= 2; +  CYCLE_DEBUG_MSG(m, "> gc_cycle_push, unwound live rec"); + #endif    }       return 0;