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.57 2000/04/13 20:14:35 hubbe Exp $"); + RCSID("$Id: gc.c,v 1.58 2000/04/13 22:19:23 grubba 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:738: Inside #if defined(PIKE_DEBUG)
   m->xrefs++;    m->flags|=GC_XREFERENCED;    gc_is_referenced(a);    return 0;   }   #endif      int gc_mark(void *a)   {    struct marker *m; -  m=get_marker(a); +  m=get_marker(debug_malloc_pass(a));       if(m->flags & GC_REFERENCED)    {    return 0;    }else{    m->flags |= GC_REFERENCED;    return 1;    }   }      #ifdef PIKE_DEBUG   int debug_gc_do_free(void *a)   {    struct marker *m; -  m=get_marker(a); +     -  +  m=get_marker(debug_malloc_pass(a)); +     if( !(m->flags & GC_REFERENCED) && (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, while gc() found %ld + %ld external. (type=%d)\n",(long)*(INT32 *)a,(long)refs,(long)xrefs,t); +  fprintf(stderr, +  "**gc_is_referenced failed, object has %ld references,\n" +  "** while gc() found %ld + %ld external. (type=%d)\n", +  (long)*(INT32 *)a,(long)refs,(long)xrefs,t);    describe_something(a, t, 1);       locate_references(a);       fatal("GC failed object (has %d, found %d + %d external)\n",    *(INT32 *)a,    refs,    xrefs);    }    }