pike.git / src / gc.c

version» Context lines:

pike.git/src/gc.c:22:   #include "time_stuff.h"   #include "constants.h"   #include "interpret.h"      #include "gc.h"   #include "main.h"   #include <math.h>      #include "block_alloc.h"    - RCSID("$Id: gc.c,v 1.102 2000/07/04 21:44:19 grubba Exp $"); + RCSID("$Id: gc.c,v 1.103 2000/07/06 23:30:40 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:1560:   }      static void warn_bad_cycles()   {    JMP_BUF uwp;    if (!SETJMP(uwp)) {    struct marker *p;    unsigned cycle = 0;    ONERROR err;    struct array *obj_arr = allocate_array(0); -  +     SET_ONERROR(err, do_free_array, obj_arr); -  +     for (p = kill_list; p;) {    if ((cycle = p->cycle)) {    push_object((struct object *) p->data);    obj_arr = append_array(obj_arr, --sp);    }    p = p->link;    if (p ? p->cycle != cycle : cycle) {    if (obj_arr->size >= 2) {    push_constant_text("gc");    push_constant_text("bad_cycle");    push_array(obj_arr); -  +  obj_arr = 0;    SAFE_APPLY_MASTER("runtime_warning", 3);    pop_stack();    obj_arr = allocate_array(0);    }    else obj_arr = resize_array(obj_arr, 0);    }    if (!p) break;    } -  +     CALL_AND_UNSET_ONERROR(err);    }    UNSETJMP(uwp);   }      int do_gc(void)   {    double tmp;    int objs, pre_kill_objs;    double multiplier;