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.188 2002/10/11 01:39:31 nilsson Exp $ + || $Id: gc.c,v 1.189 2002/11/24 22:47:06 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:24:   #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.188 2002/10/11 01:39:31 nilsson Exp $"); + RCSID("$Id: gc.c,v 1.189 2002/11/24 22:47:06 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 - #define MARKER_CHUNK_SIZE 1023 - #define GC_LINK_CHUNK_SIZE 63 + #define GC_LINK_CHUNK_SIZE 64      /* The gc will free all things with no external references that isn't    * referenced by undestructed objects with destroy() lfuns (known as    * "live" objects). Live objects without external references are then    * destructed and garbage collected with normal refcount garbing    * (which might leave dead garbage around for the next gc). These live    * objects are destructed in an order that tries to be as well defined    * as possible using several rules:    *    * o If an object A references B single way, then A is destructed
pike.git/src/gc.c:220:    (X)->frame = 0;   #endif      #ifdef PIKE_DEBUG   #undef get_marker   #define get_marker debug_get_marker   #undef find_marker   #define find_marker debug_find_marker   #endif    - PTR_HASH_ALLOC_FIXED(marker,MARKER_CHUNK_SIZE) + PTR_HASH_ALLOC_FIXED_FILL_PAGES(marker,2)      #ifdef PIKE_DEBUG      #undef get_marker   #define get_marker(X) ((struct marker *) debug_malloc_pass(debug_get_marker(X)))   #undef find_marker   #define find_marker(X) ((struct marker *) debug_malloc_pass(debug_find_marker(X)))      int gc_in_cycle_check = 0;   static unsigned delayed_freed, weak_freed, checked, marked, cycle_checked, live_ref;