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.91 2000/06/12 03:21:11 mast Exp $"); + RCSID("$Id: gc.c,v 1.92 2000/06/12 13:51:58 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:916: Inside #if defined(PIKE_DEBUG)
      Pike_in_gc = orig_in_gc;    if(!Pike_in_gc)    exit_gc();    d_flag=tmp;   }   #endif      #ifdef PIKE_DEBUG    + void debug_gc_check_count_free(void *a) + { +  struct marker *m; +  if (Pike_in_gc == GC_PASS_CHECK && (m = find_marker(a))) { +  if(m->saved_refs == -1) +  m->saved_refs = *(INT32 *)a - 1; +  else { +  if (m->saved_refs != *(INT32 *)a) +  gc_fatal(a, 1, "Refs changed in gc.\n"); +  m->saved_refs--; +  } +  } + } +    void gc_add_extra_ref(void *a)   {    struct marker *m = get_marker(a);    if (m->flags & GC_GOT_EXTRA_REF)    gc_fatal(a, 0, "Thing already got an extra gc ref.\n");    m->flags |= GC_GOT_EXTRA_REF;    gc_extra_refs++;    ++*(INT32 *) a;   }