pike.git / src / gc.c

version» Context lines:

pike.git/src/gc.c:23:   #include "constants.h"   #include "interpret.h"   #include "bignum.h"      #include "gc.h"   #include "main.h"   #include <math.h>      #include "block_alloc.h"    - RCSID("$Id: gc.c,v 1.176 2001/09/11 05:42:59 hubbe Exp $"); + RCSID("$Id: gc.c,v 1.177 2001/09/24 14:36:51 grubba 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:1913:    gc_fatal(x, 0, "Mark live recursion attempted twice into thing.\n");   #endif    goto live_recurse;    }    CYCLE_DEBUG_MSG(m, "gc_cycle_push, no live recurse");    }       else {    /* 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, no live recurse");    last->flags &= ~GC_LIVE_RECURSE;    while (1) {    struct gc_frame *l = gc_rec_top;   #ifdef PIKE_DEBUG    if (!gc_rec_top)    fatal("Expected a gc_cycle_pop entry in gc_rec_top.\n");   #endif    gc_rec_top = l->back;    if (l->frameflags & GC_POP_FRAME) {
pike.git/src/gc.c:2332:    }       CALL_AND_UNSET_ONERROR(tmp);   }      int do_gc(void)   {    double tmp;    ptrdiff_t objs, pre_kill_objs;    double multiplier; -  struct array *a; -  struct multiset *l; -  struct mapping *m; -  struct program *p; -  struct object *o; +    #ifdef PIKE_DEBUG   #ifdef HAVE_GETHRTIME    hrtime_t gcstarttime = 0;   #endif    unsigned destroy_count, obj_count;    ONERROR uwp;   #endif       if(Pike_in_gc) return 0;   #ifdef DEBUG_MALLOC
pike.git/src/gc.c:2816:       push_constant_text("num_allocs");    push_int(num_allocs);    size++;       push_constant_text("alloc_threshold");    push_int64(alloc_threshold);    size++;       push_constant_text("objects_alloced"); -  push_int64(objects_alloced); +  push_int64(DO_NOT_WARN((INT64)objects_alloced));    size++;       push_constant_text("objects_freed"); -  push_int64(objects_freed); +  push_int64(DO_NOT_WARN((INT64)objects_freed));    size++;       push_constant_text("last_gc");    push_int64(last_gc);    size++;       push_constant_text("projected_garbage"); -  push_float(objects_freed * (double) num_allocs / (double) alloc_threshold); +  push_float(DO_NOT_WARN((FLOAT_TYPE)(objects_freed * (double) num_allocs / +  (double) alloc_threshold)));    size++;       f_aggregate_mapping(size * 2);   }      void cleanup_gc(void)   {   #ifdef PIKE_DEBUG    if (gc_evaluator_callback) {    remove_callback(gc_evaluator_callback);    gc_evaluator_callback = NULL;    }   #endif /* PIKE_DEBUG */   }