Branch: Tag:

2000-07-11

2000-07-11 03:45:10 by Martin Stjernholm <mast@lysator.liu.se>

Fixed bug in gc where things which got only weak refs externally but
non-weak internal cyclic refs didn't get gc'd.

Rev: src/array.c:1.77
Rev: src/gc.c:1.105
Rev: src/gc.h:1.54
Rev: src/mapping.c:1.92
Rev: src/multiset.c:1.24
Rev: src/object.c:1.135
Rev: src/program.c:1.249
Rev: src/queue.c:1.5
Rev: src/queue.h:1.4
Rev: src/svalue.c:1.83
Rev: src/testsuite.in:1.312

5:   \*/   /**/   #include "global.h" - RCSID("$Id: program.c,v 1.248 2000/07/10 18:21:32 grubba Exp $"); + RCSID("$Id: program.c,v 1.249 2000/07/11 03:45:10 mast Exp $");   #include "program.h"   #include "object.h"   #include "dynamic_buffer.h"
3728:   {    struct program *p,*next;    +  if (gc_ext_weak_refs) { +  /* Have to go through all marked things if we got external weak +  * references to otherwise unreferenced things, so the mark +  * functions can free those references. */ +  gc_mark_program_pos = first_program; +  while (gc_mark_program_pos != gc_internal_program && gc_ext_weak_refs) { +  struct program *p = gc_mark_program_pos; +  gc_mark_program_pos = p->next; +  gc_mark_program_as_referenced(p); +  } +  discard_queue(&gc_mark_queue); +  } +     for(p=gc_internal_program;p;p=next)    {    debug_malloc_touch(p);
3765: Inside #if defined(PIKE_DEBUG)
   for (p = first_program; p != gc_internal_program; p = p->next) {    int e,tmp=0;    if (!p) -  fatal("gc_internal_program is bogus.\n"); +  fatal("gc_internal_program was bogus.\n");    for(e=0;e<p->num_constants;e++)    {    if(p->constants[e].sval.type == T_PROGRAM && p->constants[e].sval.u.program == p)