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.130 2000/09/03 23:56:17 mast Exp $"); + RCSID("$Id: gc.c,v 1.131 2000/09/04 14:28:08 grubba 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:1108: Inside #if defined(PIKE_DEBUG)
   gc_extra_refs--;   }      int debug_gc_is_referenced(void *a)   {    struct marker *m;    if (!a) fatal("Got null pointer.\n");    if (Pike_in_gc != GC_PASS_MARK)    fatal("gc_is_referenced() called in invalid gc pass.\n");    + #ifdef PIKE_DEBUG    if (gc_debug) {    m = find_marker(a);    if ((!m || !(m->flags & GC_PRETOUCHED)) &&    !safe_debug_findstring((struct pike_string *) a))    gc_fatal(a, 0, "Doing gc_is_referenced() on invalid object.\n");    if (!m) m = get_marker(a);    } -  else m = get_marker(a); +  else + #endif /* PIKE_DEBUG */ +  m = get_marker(a);       if (m->flags & GC_IS_REFERENCED)    gc_fatal(a, 0, "gc_is_referenced() called twice for thing.\n");    m->flags |= GC_IS_REFERENCED;       return !(m->flags & GC_NOT_REFERENCED);   }      int gc_external_mark3(void *a, void *in, char *where)   {
pike.git/src/gc.c:2010:    gc_mark_all_arrays();    run_queue(&gc_mark_queue);    gc_mark_all_multisets();    run_queue(&gc_mark_queue);    gc_mark_all_mappings();    run_queue(&gc_mark_queue);    gc_mark_all_programs();    run_queue(&gc_mark_queue);    gc_mark_all_objects();    run_queue(&gc_mark_queue); + #ifdef PIKE_DEBUG    if(gc_debug) gc_mark_all_strings(); -  + #endif /* PIKE_DEBUG */       GC_VERBOSE_DO(fprintf(stderr,    "| mark: %u markers referenced,\n"    "| %u weak references freed, %d things really freed\n",    marked, weak_freed, objs - num_objects));       Pike_in_gc=GC_PASS_CYCLE;   #ifdef PIKE_DEBUG    obj_count = num_objects;    max_gc_frames = 0;