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.63 2000/04/14 17:56:20 mast Exp $"); + RCSID("$Id: gc.c,v 1.64 2000/04/15 01:04:01 mast Exp $");      /* Run garbage collect approximate every time we have    * 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:793: Inside #if defined(PIKE_DEBUG)
   return (m->flags & (GC_REFERENCED|GC_CHECKED)) == GC_CHECKED;   }   #endif      void do_gc(void)   {    double tmp;    INT32 tmp2;    double multiplier;   #ifdef PIKE_DEBUG + #ifdef HAVE_GETHRTIME    hrtime_t gcstarttime;   #endif -  + #endif       if(Pike_in_gc) return;    Pike_in_gc=1;       if(gc_evaluator_callback)    {    remove_callback(gc_evaluator_callback);    gc_evaluator_callback=0;    }       tmp2=num_objects;      #ifdef PIKE_DEBUG    if(t_flag) {    fprintf(stderr,"Garbage collecting ... "); -  + #ifdef HAVE_GETHRTIME    gcstarttime = gethrtime(); -  + #endif    }    if(num_objects < 0)    fatal("Panic, less than zero objects!\n");   #endif       last_gc=TIME(0);       multiplier=pow(MULTIPLIER, (double) num_allocs / (double) alloc_threshold);    objects_alloced*=multiplier;    objects_alloced += (double) num_allocs;
pike.git/src/gc.c:910:    if(alloc_threshold < MIN_ALLOC_THRESHOLD)    alloc_threshold = MIN_ALLOC_THRESHOLD;    if(alloc_threshold > MAX_ALLOC_THRESHOLD)    alloc_threshold = MAX_ALLOC_THRESHOLD;    num_allocs=0;      #ifdef PIKE_DEBUG    if(t_flag)    fprintf(stderr,"done (freed %ld of %ld objects), %ld ms.\n",    (long)(tmp2-num_objects),(long)tmp2, -  (long)((gethrtime() - gcstarttime)/1000000)); + #ifdef HAVE_GETHRTIME +  (long)((gethrtime() - gcstarttime)/1000000) + #else +  0l   #endif -  +  ); + #endif      #ifdef ALWAYS_GC    ADD_GC_CALLBACK();   #else    if(d_flag > 3) ADD_GC_CALLBACK();   #endif    Pike_in_gc=0;   }