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.239 2004/03/15 14:07:39 mast Exp $ + || $Id: gc.c,v 1.240 2004/03/15 19:03:48 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.239 2004/03/15 14:07:39 mast Exp $"); + RCSID("$Id: gc.c,v 1.240 2004/03/15 19:03:48 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:330:       for (c = first_callable; c; c = c->next)    if (c == (struct callable *) something)    return T_STRUCT_CALLABLE;       return PIKE_T_UNKNOWN;   }      void *check_for =0;   void *gc_svalue_location=0; + static size_t found_ref_count; +    char *fatal_after_gc=0;      #ifdef DEBUG_MALLOC      /* To keep the markers after the gc. Only used for the dmalloc leak    * report at exit. */   int gc_keep_markers = 0;      int gc_external_refs_zapped = 0;   
pike.git/src/gc.c:709: Inside #if defined(PIKE_DEBUG)
   fatal_after_gc = "Fatal in garbage collector.\n";    else   #endif    debug_fatal("Fatal in garbage collector.\n");   }      #ifdef PIKE_DEBUG      static void gdb_gc_stop_here(void *a, int weak)   { +  found_ref_count++;    fprintf(stderr,"***One %sref found%s. ",    weak ? "weak " : "",    gc_found_place ? gc_found_place : "");    if (gc_found_in) {    if (gc_svalue_location)    describe_location(gc_found_in , gc_found_in_type, gc_svalue_location,0,1,    DESCRIBE_SHORT);    else {    fputc('\n', stderr);    describe_something(gc_found_in, gc_found_in_type, 0, 0, DESCRIBE_SHORT, 0);
pike.git/src/gc.c:1611: Inside #if defined(PIKE_DEBUG)
   }    Pike_in_gc = GC_PASS_LOCATE;       /* 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;       GC_ENTER (NULL, PIKE_T_UNKNOWN) {    mark_externals();    call_callback(& gc_callbacks, NULL);       gc_check_all_arrays();    gc_check_all_multisets();    gc_check_all_mappings();    gc_check_all_programs();    gc_check_all_objects();
pike.git/src/gc.c:1633: Inside #if defined(PIKE_DEBUG) and #if defined(DEBUG_MALLOC)
  #ifdef DEBUG_MALLOC    {    extern void dmalloc_find_references_to(void *);   #if 0    fprintf(stderr,"**DMALLOC Looking for references:\n");    dmalloc_find_references_to(a);   #endif    }   #endif    -  fprintf(stderr,"**Done looking for references to %p.\n", a); +  fprintf(stderr,"**Done looking for references to %p, " +  "found %"PRINTSIZET"d refs.\n", a, found_ref_count);       Pike_in_gc = orig_in_gc;    if(i) exit_gc();    d_flag=tmp;   }      void debug_gc_add_extra_ref(void *a)   {    struct marker *m;