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.261 2006/04/02 07:24:47 mast Exp $ + || $Id: gc.c,v 1.262 2007/03/07 18:41:31 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.261 2006/04/02 07:24:47 mast Exp $"); + RCSID("$Id: gc.c,v 1.262 2007/03/07 18:41:31 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:1372: Inside #if defined(PIKE_DEBUG)
   else    gc_fatal(a, 1, "Thing has gotten more references since gc start.\n");    else    if (m->weak_refs > m->saved_refs)    gc_fatal(a, 0, "A thing got more weak references than references.\n");   #endif    m->flags |= GC_MIDDLETOUCHED;    break;    }    + #if 0 +  /* Disabled since we can't assume any correlation between the +  * marks and the actual blocks in or after GC_PASS_FREE. */    case GC_PASS_POSTTOUCH:    m = find_marker(a);    if (!*(INT32 *) a)    gc_fatal(a, 1, "Found a thing without refs.\n");    if (m) {    if (!(m->flags & (GC_PRETOUCHED|GC_MIDDLETOUCHED)))    gc_fatal(a, 2, "An existing but untouched marker found "    "for object in linked lists.\n");    else if (m->flags & GC_LIVE_RECURSE ||    (m->frame && m->frame->frameflags & (GC_WEAK_REF|GC_STRONG_REF)))
pike.git/src/gc.c:1414: Inside #if defined(PIKE_DEBUG)
   else if (!(m->flags & GC_LIVE)) {    if (m->weak_refs < 0)    gc_fatal(a, 3, "A thing which had only weak references is "    "still around after gc.\n");    else    gc_fatal(a, 3, "A thing to garb is still around.\n");    }   #endif    }    break; + #endif       default:    Pike_fatal("debug_gc_touch() used in invalid gc pass.\n");    }   }      #ifdef PIKE_DEBUG      static INLINE struct marker *gc_check_debug(void *a, int weak)   {
pike.git/src/gc.c:3111:    GC_VERBOSE_DO(fprintf(stderr, "| kill: %u objects killed, %d things really freed\n",    destroy_count, pre_kill_objs - num_objects));       Pike_in_gc=GC_PASS_DESTRUCT;    /* Destruct objects on the destruct queue. */    GC_VERBOSE_DO(obj_count = num_objects);    destruct_objects_to_destruct();    GC_VERBOSE_DO(fprintf(stderr, "| destruct: %d things really freed\n",    obj_count - num_objects));    + #if 0 +  /* Disabled since we can't assume any correlation between the +  * marks and the actual blocks in or after GC_PASS_FREE. */    if (gc_debug) {    unsigned n;    Pike_in_gc=GC_PASS_POSTTOUCH;    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();    /* gc_touch_all_strings(); */    if (n != (unsigned) num_objects)    Pike_fatal("Object count wrong after gc; expected %d, got %d.\n", num_objects, n);    GC_VERBOSE_DO(fprintf(stderr, "| posttouch: %u things\n", n));    } -  + #endif +    #ifdef PIKE_DEBUG    if (gc_extra_refs) {    size_t e;    fprintf (stderr, "Lost track of %d extra refs to things in gc.\n"    "Searching for marker(s) with extra refs:\n", gc_extra_refs);    for (e = 0; e < marker_hash_table_size; e++) {    struct marker *s = marker_hash_table[e], *m;    for (m = s; m;) {    if (m->flags & GC_GOT_EXTRA_REF) {    fprintf (stderr, "========================================\n"