pike.git / src / gc.c

version» Context lines:

pike.git/src/gc.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: gc.c,v 1.255 2004/09/28 16:56:00 mast Exp $ + || $Id: gc.c,v 1.256 2004/09/30 12:12:10 mast Exp $   */      #include "global.h"      struct callback *gc_evaluator_callback=0;      #include "array.h"   #include "multiset.h"   #include "mapping.h"   #include "object.h"
pike.git/src/gc.c:26:   #include "interpret.h"   #include "bignum.h"   #include "pike_threadlib.h"      #include "gc.h"   #include "main.h"   #include <math.h>      #include "block_alloc.h"    - RCSID("$Id: gc.c,v 1.255 2004/09/28 16:56:00 mast Exp $"); + RCSID("$Id: gc.c,v 1.256 2004/09/30 12:12:10 mast Exp $");      int gc_enabled = 1;      /* These defaults are only guesses and hardly tested at all. Please improve. */   double gc_garbage_ratio_low = 0.2;   double gc_time_ratio = 0.05;   double gc_garbage_ratio_high = 0.5;      /* This slowness factor approximately corresponds to the average over    * the last ten gc rounds. (0.9 == 1 - 1/10) */
pike.git/src/gc.c:2428: Inside #if defined(PIKE_DEBUG)
   if (m->flags & GC_LIVE)    Pike_fatal("Shouldn't live recurse when there's nothing to do.\n");   #endif    m->flags |= GC_LIVE|GC_LIVE_RECURSE;    debug_malloc_touch(x);       if (m->flags & GC_GOT_DEAD_REF) {    /* A thing previously popped as dead is now being marked live.    * Have to remove the extra ref added by gc_cycle_pop(). */    gc_free_extra_ref(x); -  if (!--*(INT32 *) x) { +  if (!sub_ref ((struct ref_dummy *) x)) {   #ifdef PIKE_DEBUG    gc_fatal(x, 0, "Thing got zero refs after removing the dead gc ref.\n");   #endif    }    }       {    /* Recurse without linking onto rec_list. */    struct gc_frame *l = gc_cycle_enqueue_pop(x);   #ifdef GC_CYCLE_DEBUG
pike.git/src/gc.c:2595:       if (gc_destruct_everything) {    /* We don't actually free much in this mode, just destruct    * objects. So when we normally would return nonzero we just    * remove the extra ref again. */    if (!(m->flags & GC_LIVE)) {    if (*(INT32 *) a == 1)    return 1;    else {    gc_free_extra_ref (a); -  --*(INT32 *) a; +  sub_ref ((struct ref_dummy *) a);    }    }    return 0;    }      #ifdef PIKE_DEBUG    if (*(INT32 *) a > !!(m->flags & GC_GOT_EXTRA_REF)) {    if (!gc_destruct_everything &&    (!(m->flags & GC_NOT_REFERENCED) || m->flags & GC_MARKED))    gc_fatal(a, 0, "gc_do_free() called for referenced thing.\n");