pike.git / src / gc.c

version» Context lines:

pike.git/src/gc.c:23:   #include "constants.h"   #include "interpret.h"   #include "bignum.h"      #include "gc.h"   #include "main.h"   #include <math.h>      #include "block_alloc.h"    - RCSID("$Id: gc.c,v 1.154 2001/06/26 21:03:49 hubbe Exp $"); + RCSID("$Id: gc.c,v 1.155 2001/06/27 02:06:41 hubbe Exp $");      /* Run garbage collect approximately every time    * 20 percent of all arrays, objects and programs is    * garbage.    */      #define GC_CONST 20   #define MIN_ALLOC_THRESHOLD 1000   #define MAX_ALLOC_THRESHOLD 10000000   #define MULTIPLIER 0.9
pike.git/src/gc.c:767:    debug_dump_array((struct array *)a);    break;       case T_MAPPING_DATA:    {    struct mapping *m;    for(m=first_mapping;m;m=m->next)    {    if(m->data == (struct mapping_data *)a)    { -  fprintf(stderr,"%*s**Describing mapping:\n",indent,""); +  fprintf(stderr,"%*s**Describing mapping for this data block:\n",indent,"");    debug_dump_mapping((struct mapping *)m); -  describe_something( m, T_MAPPING, indent+2,depth-1,flags); +     }    }    break;    }       case T_MAPPING:    fprintf(stderr,"%*s**Describing mapping:\n",indent,"");    debug_dump_mapping((struct mapping *)a);    fprintf(stderr,"%*s**Describing mapping data block:\n",indent,"");    describe_something( ((struct mapping *)a)->data, -2, indent+2,depth-1,flags);
pike.git/src/gc.c:1052: Inside #if defined(GC_VERBOSE)
  #ifdef GC_VERBOSE    num_gc_frames = 0;   #endif   }      #ifdef PIKE_DEBUG   void locate_references(void *a)   {    int tmp, orig_in_gc = Pike_in_gc;    void *orig_check_for=check_for; -  if(!Pike_in_gc) +  int i=0; +  if(!marker_blocks) +  { +  i=1;    init_gc(); -  +  }    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:\n");       check_for=a;   
pike.git/src/gc.c:1110: Inside #if defined(PIKE_DEBUG) and #if defined(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       Pike_in_gc = orig_in_gc; -  if(!Pike_in_gc) -  exit_gc(); +  if(i) exit_gc();    d_flag=tmp;   }   #endif      #ifdef PIKE_DEBUG      void debug_gc_add_extra_ref(void *a)   {    struct marker *m = get_marker(a);    if (m->flags & GC_GOT_EXTRA_REF)
pike.git/src/gc.c:2178: Inside #if defined(PIKE_DEBUG)
   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();    gc_touch_all_strings();    if (n != (unsigned) num_objects)    fatal("Object count wrong in gc; expected %d, got %d.\n", num_objects, n);    get_marker(rec_list.data)->flags |= GC_MIDDLETOUCHED; + #if 0 /* Temporarily disabled - Hubbe */   #ifdef DEBUG_MALLOC    PTR_HASH_LOOP(marker, i, m)    if (!(m->flags & (GC_MIDDLETOUCHED|GC_WEAK_FREED)) &&    dmalloc_is_invalid_memory_block(m->data)) {    fprintf(stderr, "Found a stray marker after middletouch pass: ");    describe_marker(m);    fprintf(stderr, "Describing marker location(s):\n");    debug_malloc_dump_references(m, 2, 1, 0);    fprintf(stderr, "Describing thing for marker:\n");    Pike_in_gc = 0;    describe(m->data);    Pike_in_gc = GC_PASS_MIDDLETOUCH;    fatal("Fatal in garbage collector.\n");    }   #endif -  + #endif    GC_VERBOSE_DO(fprintf(stderr, "| middletouch\n"));    }   #endif       if (gc_ext_weak_refs) {    size_t to_free = gc_ext_weak_refs;   #ifdef PIKE_DEBUG    obj_count = num_objects;   #endif    Pike_in_gc = GC_PASS_ZAP_WEAK;