pike.git / src / gc.c

version» Context lines:

pike.git/src/gc.c:22:   #include "time_stuff.h"   #include "constants.h"   #include "interpret.h"      #include "gc.h"   #include "main.h"   #include <math.h>      #include "block_alloc.h"    - RCSID("$Id: gc.c,v 1.107 2000/07/18 05:48:20 mast Exp $"); + RCSID("$Id: gc.c,v 1.108 2000/07/18 06:30:57 mast Exp $");      /* Run garbage collect approximately every time    * 20 percent of all arrays, objects and programs is    * garbage.    */      #define GC_CONST 20   #define MIN_ALLOC_THRESHOLD 1000   #define MAX_ALLOC_THRESHOLD 10000000   #define MULTIPLIER 0.9
pike.git/src/gc.c:2041:    * cycles. */    pre_kill_objs = num_objects;    if (last_cycle) {    objs -= num_objects;    warn_bad_cycles();    objs += num_objects;    }   #ifdef PIKE_DEBUG    destroy_count = 0;   #endif -  for (; kill_list; kill_list = NEXT(kill_list)) { +  while (kill_list) { +  struct gc_frame *next = NEXT(kill_list);    struct object *o = (struct object *) kill_list->data;   #ifdef PIKE_DEBUG    if ((get_marker(kill_list->data)->flags & (GC_LIVE|GC_LIVE_OBJ)) !=    (GC_LIVE|GC_LIVE_OBJ))    gc_fatal(o, 0, "Invalid thing in kill list.\n");    if (o->parent && !o->parent->prog &&    get_marker(o->parent)->flags & GC_LIVE_OBJ)    gc_fatal(o, 0, "GC destructed parent prematurely.\n");   #endif    GC_VERBOSE_DO(fprintf(stderr, "| Killing %p with %d refs\n",    o, o->refs));    destruct(o);    free_object(o);    gc_free_extra_ref(o);   #ifdef PIKE_DEBUG    destroy_count++;   #endif -  +  really_free_gc_frame(kill_list); +  kill_list = next;    }       GC_VERBOSE_DO(fprintf(stderr, "| kill: %u objects killed, %d things really freed\n",    destroy_count, pre_kill_objs - num_objects));       Pike_in_gc=GC_PASS_DESTRUCT;    /* Destruct objects on the destruct queue. */    GC_VERBOSE_DO(obj_count = num_objects);    destruct_objects_to_destruct();    GC_VERBOSE_DO(fprintf(stderr, "| destruct: %d things really freed\n",