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.110 2000/07/28 17:16:55 hubbe Exp $"); + RCSID("$Id: gc.c,v 1.111 2000/08/03 18:37:57 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:1106: Inside #if defined(PIKE_DEBUG)
   (m->saved_refs != -1 && m->saved_refs != *(INT32 *)a)))    gc_fatal(a, 1, "Ref counts are wrong.\n");    return 0;   }      void debug_really_free_gc_frame(struct gc_frame *l)   {    if (l->frameflags & GC_LINK_FREED)    gc_fatal(l->data, 0, "Freeing freed gc_frame.\n");    l->frameflags |= GC_LINK_FREED; -  l->back = PREV(l) = NEXT(l) = (struct gc_frame *) -1; +  l->back = PREV(l) = NEXT(l) = (struct gc_frame *)(ptrdiff_t) -1;    really_free_gc_frame(l);   #ifdef GC_VERBOSE    num_gc_frames--;   #endif   }      #else /* PIKE_DEBUG */      #define debug_really_free_gc_frame(l) really_free_gc_frame(l)   
pike.git/src/gc.c:1681:    }       here = m->frame;   #ifdef PIKE_DEBUG    if (!here || here->data != a)    gc_fatal(a, 0, "Marker being popped has no or invalid frame.\n");    CHECK_POP_FRAME(here);    CHECK_POP_FRAME(gc_rec_last);    if (here->frameflags & GC_OFF_STACK)    gc_fatal(a, 0, "Marker being popped isn't on stack.\n"); -  here->back = (struct gc_frame *) -1; +  here->back = (struct gc_frame *)(ptrdiff_t) -1;   #endif    here->frameflags |= GC_OFF_STACK;       for (base = PREV(here), p = here;; base = p, p = NEXT(p)) {    if (base == here) {    /* Part of a cycle; wait until the cycle is complete before    * unlinking it from rec_list. */ -  DO_IF_DEBUG(m->frame->back = (struct gc_frame *) -1); +  DO_IF_DEBUG(m->frame->back = (struct gc_frame *)(ptrdiff_t) -1);    CYCLE_DEBUG_MSG(m, "gc_cycle_pop, keep cycle");    return;    }    CHECK_POP_FRAME(p);    if (!(CYCLE(p) && CYCLE(p) == CYCLE(base)))    break;    }       gc_rec_last = base;    while ((p = NEXT(base))) {
pike.git/src/gc.c:1712: Inside #if defined(PIKE_DEBUG)
   if (pm->frame != p)    gc_fatal(p->data, 0, "Bogus marker for thing being popped.\n");    if (pm->flags & GC_GOT_DEAD_REF)    gc_fatal(p->data, 0, "Didn't expect a dead extra ref.\n");   #endif    p->frameflags &= ~(GC_WEAK_REF|GC_STRONG_REF);    if (pm->flags & GC_LIVE_OBJ) {    /* This extra ref is taken away in the kill pass. */    gc_add_extra_ref(p->data);    base = p; -  DO_IF_DEBUG(PREV(p) = (struct gc_frame *) -1); +  DO_IF_DEBUG(PREV(p) = (struct gc_frame *)(ptrdiff_t) -1);    CYCLE_DEBUG_MSG(pm, "gc_cycle_pop, put on kill list");    }    else {    if (!(pm->flags & GC_LIVE)) {    /* Add an extra ref which is taken away in the free pass. This    * is done to not refcount garb the cycles themselves    * recursively, which in bad cases can consume a lot of C    * stack. */   #ifdef PIKE_DEBUG    if (pm->flags & GC_GOT_DEAD_REF)