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.217 2003/04/28 00:34:12 mast Exp $ + || $Id: gc.c,v 1.218 2003/05/12 12:18:41 nilsson 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.217 2003/04/28 00:34:12 mast Exp $"); + RCSID("$Id: gc.c,v 1.218 2003/05/12 12:18:41 nilsson 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:630:    putc('\n', stderr);    }    else    fprintf(stderr, "no marker\n");   }      #endif /* PIKE_DEBUG */      void debug_gc_fatal(void *a, int flags, const char *fmt, ...)   { + #ifdef PIKE_DEBUG    struct marker *m; -  + #endif    int orig_gc_pass = Pike_in_gc;    va_list args;       va_start(args, fmt);       fprintf(stderr, "**");    (void) VFPRINTF(stderr, fmt, args);       va_end(args);   
pike.git/src/gc.c:1155:    )))    gc_fatal(a, 1, "Thing got an existing but untouched marker.\n");    m = get_marker(a);    m->flags |= GC_PRETOUCHED;   #ifdef PIKE_DEBUG    m->saved_refs = *(INT32 *) a;   #endif    break;       case GC_PASS_MIDDLETOUCH: { + #ifdef PIKE_DEBUG    int extra_ref; -  + #endif    m = find_marker(a);    if (!m)    gc_fatal(a, 1, "Found a thing without marker.\n");    else if (!(m->flags & GC_PRETOUCHED))    gc_fatal(a, 1, "Thing got an existing but untouched marker.\n");   #ifdef PIKE_DEBUG    extra_ref = (m->flags & GC_GOT_EXTRA_REF) == GC_GOT_EXTRA_REF;    if (m->saved_refs + extra_ref < *(INT32 *) a)    if (m->flags & GC_WEAK_FREED)    gc_fatal(a, 1, "Something failed to remove weak reference(s) to thing, "
pike.git/src/gc.c:1872:   #else   #define CYCLE_DEBUG_MSG(M, TXT) do {} while (0)   #endif      static void rotate_rec_list (struct gc_frame *beg, struct gc_frame *pos)   /* Rotates the marker list and the cycle stack so the bit from pos    * down to the end gets before the bit from beg down to pos. The beg    * pos might be moved further down the stack to avoid mixing cycles or    * breaking strong link sequences. */   { + #ifdef GC_STACK_DEBUG    struct gc_frame *l; -  + #endif    CYCLE_DEBUG_MSG(find_marker(beg->data), "> rotate_rec_list, asked to begin at");      #ifdef PIKE_DEBUG    if (Pike_in_gc != GC_PASS_CYCLE)    Pike_fatal("Use of the gc frame stack outside the cycle check pass.\n");    CHECK_POP_FRAME(beg);    CHECK_POP_FRAME(pos);    if (beg == pos)    gc_fatal(beg->data, 0, "Cycle already broken at requested position.\n");    if (NEXT(gc_rec_last))
pike.git/src/gc.c:2712:    fprintf(stderr,    "| zap weak: freed %"PRINTPTRDIFFT"d external weak refs, "    "%"PRINTSIZET"u internal still around,\n"    "| %d more things to free\n",    to_free - gc_ext_weak_refs, gc_ext_weak_refs,    delayed_freed - obj_count));    }       if (gc_debug) {    unsigned n; + #ifdef DEBUG_MALLOC    size_t i;    struct marker *m; -  + #endif    Pike_in_gc=GC_PASS_MIDDLETOUCH;    n = gc_touch_all_arrays();    n += gc_touch_all_multisets();    n += gc_touch_all_mappings();    n += gc_touch_all_programs();    n += gc_touch_all_objects();   #ifdef PIKE_DEBUG    gc_touch_all_strings();   #endif    if (n != (unsigned) num_objects)