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.249 2004/04/03 17:34:34 mast Exp $ + || $Id: gc.c,v 1.250 2004/04/04 21:54:04 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.249 2004/04/03 17:34:34 mast Exp $"); + RCSID("$Id: gc.c,v 1.250 2004/04/04 21:54:04 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:1463: Inside #if defined(PIKE_DEBUG)
      m = get_marker(a);       if (!*(INT32 *)a)    gc_fatal(a, 1, "GC check on thing without refs.\n");    if (m->saved_refs == -1) m->saved_refs = *(INT32 *)a;    else if (m->saved_refs != *(INT32 *)a)    gc_fatal(a, 1, "Refs changed in gc check pass.\n");    if (m->refs + m->xrefs >= *(INT32 *) a)    /* m->refs will be incremented by the caller. */ -  gc_fatal(a, 1, "Thing is getting more internal refs than refs.\n"); +  gc_fatal(a, 1, "Thing is getting more internal refs than refs " +  "(a pointer has probably been checked more than once).\n");    checked++;       return m;   }      #endif /* PIKE_DEBUG */      PMOD_EXPORT INT32 real_gc_check(void *a)   {    struct marker *m;
pike.git/src/gc.c:1598: Inside #if defined(PIKE_DEBUG)
   struct mapping *constants;    if (master_object)    gc_mark_external (master_object, " as master_object");    if ((constants = get_builtin_constants()))    gc_mark_external (constants, " as global constants mapping");   }      void locate_references(void *a)   {    int tmp, orig_in_gc = Pike_in_gc; +  const char *orig_gc_found_place = gc_found_place;    int i=0;    if(!marker_blocks)    {    i=1;    init_gc();    }    Pike_in_gc = GC_PASS_LOCATE; -  +  gc_found_place = NULL;       /* Disable debug, this may help reduce recursion bugs */    tmp=d_flag;    d_flag=0;       fprintf(stderr,"**Looking for references to %p:\n", a);       check_for=a;    found_ref_count = 0;   
pike.git/src/gc.c:1640: Inside #if defined(PIKE_DEBUG), #if defined(DEBUG_MALLOC) and #if 0
   fprintf(stderr,"**DMALLOC Looking for references:\n");    dmalloc_find_references_to(a);   #endif    }   #endif       fprintf(stderr,"**Done looking for references to %p, "    "found %"PRINTSIZET"d refs.\n", a, found_ref_count);       Pike_in_gc = orig_in_gc; +  gc_found_place = orig_gc_found_place;    if(i) exit_gc();    d_flag=tmp;   }      void debug_gc_add_extra_ref(void *a)   {    struct marker *m;       if (gc_is_watching && (m = find_marker(a)) && m->flags & GC_WATCHED) {    /* This is useful to set breakpoints on. */