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.129 2000/09/03 23:11:29 mast Exp $"); + RCSID("$Id: gc.c,v 1.130 2000/09/03 23:56:17 mast 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:2089:    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;    /* Zap weak references from external to internal things. That    * doesn't occur very often; only when something have both    * external weak refs and nonweak cyclic refs from internal    * things. */ +  gc_zap_ext_weak_refs_in_mappings(); +  if (gc_ext_weak_refs) {    gc_zap_ext_weak_refs_in_arrays();    /* Multisets handled as arrays. */    if (gc_ext_weak_refs) { -  gc_zap_ext_weak_refs_in_mappings(); -  if (gc_ext_weak_refs) { -  gc_zap_ext_weak_refs_in_programs(); -  if (gc_ext_weak_refs) +     gc_zap_ext_weak_refs_in_objects(); -  +  if (gc_ext_weak_refs) +  gc_zap_ext_weak_refs_in_programs();    }    }    GC_VERBOSE_DO(    fprintf(stderr,    "| zap weak: freed %u external weak refs, %d things really freed\n",    to_free - gc_ext_weak_refs, obj_count - num_objects));    }       /* Thread switches, object alloc/free and reference changes are    * allowed again now. */