Branch: Tag:

1998-04-29

1998-04-29 02:45:22 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

garbage collector now uses a queue instead of recursion

Rev: src/Makefile.in:1.85
Rev: src/gc.c:1.37
Rev: src/gc.h:1.18
Rev: src/queue.c:1.1
Rev: src/queue.h:1.1
Rev: src/svalue.c:1.31

25:   #include "main.h"   #include <math.h>    - RCSID("$Id: gc.c,v 1.36 1998/04/24 00:32:08 hubbe Exp $"); + RCSID("$Id: gc.c,v 1.37 1998/04/29 02:45:21 hubbe Exp $");      /* Run garbage collect approximate every time we have    * 20 percent of all arrays, objects and programs is
42:   INT32 num_allocs =0;   INT32 alloc_threshold = MIN_ALLOC_THRESHOLD;   static int in_gc = 0; + struct queue gc_mark_queue;      static double objects_alloced = 0.0;   static double objects_freed = 0.0;
609:       /* Next we mark anything with external references */    gc_mark_all_arrays(); +  run_queue(&gc_mark_queue);    gc_mark_all_multisets(); -  +  run_queue(&gc_mark_queue);    gc_mark_all_mappings(); -  +  run_queue(&gc_mark_queue);    gc_mark_all_programs(); -  +  run_queue(&gc_mark_queue);    gc_mark_all_objects(); -  +  run_queue(&gc_mark_queue);       if(d_flag)    gc_mark_all_strings();