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.196 2003/09/08 15:28:14 mast Exp $ + || $Id: gc.c,v 1.197 2003/09/09 08:29:31 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.196 2003/09/08 15:28:14 mast Exp $"); + RCSID("$Id: gc.c,v 1.197 2003/09/09 08:29:31 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 2000000000   #define MULTIPLIER 0.9
pike.git/src/gc.c:1233:    free((char *) b);    b = next;    }    gc_mark_first = gc_mark_last = 0;   }      void gc_mark_enqueue (queue_call call, void *data)   {    struct gc_queue_block *b;    + #ifdef PIKE_DEBUG +  { +  struct marker *m; +  if (gc_is_watching && (m = find_marker(data)) && m->flags & GC_WATCHED) { +  /* This is useful to set breakpoints on. */ +  fprintf(stderr, "## Watched thing %p found in " +  "gc_mark_enqueue() in pass %d.\n", data, Pike_in_gc); +  } +  } + #endif +     b=gc_mark_last;    if(!b || b->used >= GC_QUEUE_ENTRIES)    {    b = (struct gc_queue_block *) malloc (sizeof (struct gc_queue_block));    if (!b) fatal ("Out of memory in gc.\n");    b->used=0;    b->next=0;    if(gc_mark_first)    gc_mark_last->next=b;    else
pike.git/src/gc.c:1810:    l->u.free_extra_type = type;    l->back = free_extra_list;    l->frameflags = 0;    free_extra_list = l;    }       gc_add_extra_ref(a);    m->flags |= GC_GOT_DEAD_REF;   }    - #ifdef PIKE_DEBUG - void gc_mark_enqueue(queue_call call, void *data) - { -  struct marker *m; -  if (gc_is_watching && (m = find_marker(data)) && m->flags & GC_WATCHED) { -  /* This is useful to set breakpoints on. */ -  fprintf(stderr, "## Watched thing %p found in " -  "gc_mark_enqueue() in pass %d.\n", data, Pike_in_gc); -  } -  enqueue(&gc_mark_queue, call, data); - } - #endif -  +    int gc_mark(void *a)   {    struct marker *m = get_marker(debug_malloc_pass(a));      #ifdef PIKE_DEBUG    if (gc_is_watching && m && m->flags & GC_WATCHED) {    /* This is useful to set breakpoints on. */    fprintf(stderr, "## Watched thing %p found in "    "gc_mark() in pass %d.\n", a, Pike_in_gc);    }