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.62 2000/04/14 16:33:00 hubbe Exp $"); + RCSID("$Id: gc.c,v 1.63 2000/04/14 17:56:20 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:760:    }   }      #ifdef PIKE_DEBUG   int debug_gc_do_free(void *a)   {    struct marker *m;       m=get_marker(debug_malloc_pass(a));    -  if( !(m->flags & GC_REFERENCED) && (m->flags & GC_XREFERENCED) ) +  if( (m->flags & (GC_REFERENCED|GC_CHECKED)) == GC_CHECKED && +  (m->flags & GC_XREFERENCED) )    {    INT32 refs=m->refs;    INT32 xrefs=m->xrefs;    TYPE_T t=attempt_to_identify(a);    if(t != T_STRING && t != T_UNKNOWN)    {    fprintf(stderr,    "**gc_is_referenced failed, object has %ld references,\n"    "** while gc() found %ld + %ld external. (type=%d, flags=%d)\n",    (long)*(INT32 *)a,(long)refs,(long)xrefs,t,m->flags);
pike.git/src/gc.c:791: 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    hrtime_t gcstarttime; -  + #endif       if(Pike_in_gc) return;    Pike_in_gc=1;       if(gc_evaluator_callback)    {    remove_callback(gc_evaluator_callback);    gc_evaluator_callback=0;    }