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.144 2000/12/14 07:24:37 mast Exp $"); + RCSID("$Id: gc.c,v 1.145 2001/06/06 02:22:35 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:88: Inside #if defined(GC_VERBOSE) && !defined(PIKE_DEBUG)
     #if defined(GC_VERBOSE) && !defined(PIKE_DEBUG)   #undef GC_VERBOSE   #endif   #ifdef GC_VERBOSE   #define GC_VERBOSE_DO(X) X   #else   #define GC_VERBOSE_DO(X)   #endif    - INT32 num_objects = 1; /* Account for empty_array. */ + INT32 num_objects = 3; /* Account for *_empty_array. */   INT32 num_allocs =0;   ptrdiff_t alloc_threshold = MIN_ALLOC_THRESHOLD;   PMOD_EXPORT int Pike_in_gc = 0;   struct pike_queue gc_mark_queue;   time_t last_gc;      struct gc_frame   {    struct gc_frame *back; /* Previous stack frame. */    void *data;
pike.git/src/gc.c:1955:    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;    init_gc();    Pike_in_gc=GC_PASS_PREPARE;   #ifdef PIKE_DEBUG    gc_debug = d_flag; -  +  SET_ONERROR(uwp, fatal_on_error, "Shouldn't get an exception inside the gc.\n");   #endif       destruct_objects_to_destruct();       if(gc_evaluator_callback)    {    remove_callback(gc_evaluator_callback);    gc_evaluator_callback=0;    }   
pike.git/src/gc.c:2318:    if(tmp < MIN_ALLOC_THRESHOLD)    tmp = (double)MIN_ALLOC_THRESHOLD;    if(tmp > MAX_ALLOC_THRESHOLD)    tmp = (double)MAX_ALLOC_THRESHOLD;       alloc_threshold = (ptrdiff_t)tmp;       num_allocs=0;      #ifdef PIKE_DEBUG +  UNSET_ONERROR (uwp);    if(GC_VERBOSE_DO(1 ||) t_flag)    {   #ifdef HAVE_GETHRTIME    fprintf(stderr,"done (freed %ld of %ld objects), %ld ms.\n",    (long)objs,(long)objs + num_objects,    (long)((gethrtime() - gcstarttime)/1000000));   #else    fprintf(stderr,"done (freed %ld of %ld objects)\n",    (long)objs,(long)objs + num_objects);   #endif