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.235 2003/09/24 00:59:31 mast Exp $ + || $Id: gc.c,v 1.236 2003/09/24 01:08:09 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:26:   #include "interpret.h"   #include "bignum.h"   #include "pike_threadlib.h"      #include "gc.h"   #include "main.h"   #include <math.h>      #include "block_alloc.h"    - RCSID("$Id: gc.c,v 1.235 2003/09/24 00:59:31 mast Exp $"); + RCSID("$Id: gc.c,v 1.236 2003/09/24 01:08:09 mast Exp $");      int gc_enabled = 1;      /* These defaults are only guesses and hardly tested at all. Please improve. */   double gc_garbage_ratio_low = 0.2;   double gc_time_ratio = 0.05;   double gc_garbage_ratio_high = 0.5;      /* This slowness factor approximately corresponds to the average over    * the last ten gc rounds. (0.9 == 1 - 1/10) */
pike.git/src/gc.c:338: Inside #if defined(DEBUG_MALLOC)
     /* To keep the markers after the gc. Only used for the dmalloc leak    * report at exit. */   int gc_keep_markers = 0;      int gc_external_refs_zapped = 0;      #endif      #define DESCRIBE_MEM 1 - #define DESCRIBE_NO_REFS 2 +    #define DESCRIBE_SHORT 4   #define DESCRIBE_NO_DMALLOC 8      /* type == -1 means that memblock is a char* and should be    * really be printed..    */   void describe_location(void *real_memblock,    int type,    void *location,    int indent,
pike.git/src/gc.c:844: Inside #if defined(PIKE_DEBUG)
   if (!var_count)    fprintf (stderr, "%*s** (none)\n", indent, "");       fprintf(stderr,"%*s**Describing program %p of object:\n",indent,"", p);   #ifdef DEBUG_MALLOC    if ((int) p == 0x55555555)    fprintf(stderr, "%*s**Zapped program pointer.\n", indent, "");    else   #endif    low_describe_something(p, T_PROGRAM, indent, depth, -  flags | DESCRIBE_SHORT, 0); +  depth ? flags : flags | DESCRIBE_SHORT, 0);       if((p->flags & PROGRAM_USES_PARENT) &&    LOW_PARENT_INFO(((struct object *)a),p)->parent)    {    if (depth) {    fprintf(stderr,"%*s**Describing parent of object:\n",indent,"");    describe_something( PARENT_INFO((struct object *)a)->parent, T_OBJECT,    indent+2, depth-1, -  (flags | DESCRIBE_SHORT | DESCRIBE_NO_REFS ) -  & ~ (DESCRIBE_MEM), +  (flags | DESCRIBE_SHORT) & ~DESCRIBE_MEM,    0);    }    else    fprintf (stderr, "%*s**Object got a parent.\n", indent, "");    }else{    fprintf(stderr,"%*s**There is no parent (any longer?)\n",indent,"");    }    }    break;   
pike.git/src/gc.c:1195:    {    fprintf(stderr," Function (destructed) name: %s\n",ID_FROM_INT(p,s->subtype)->name->str);    }else{    fprintf(stderr," Function in destructed object.\n");    }    }else{    fprintf(stderr," Function name: %s\n",ID_FROM_INT(s->u.object->prog,s->subtype)->name->str);    }    }    } -  describe_something(s->u.refs,s->type,0,0,0,0); +  describe_something(s->u.refs,s->type,0,1,0,0);   }      void gc_watch(void *a)   {    struct marker *m;    init_gc();    m = get_marker(a);    if (!(m->flags & GC_WATCHED)) {    m->flags |= GC_WATCHED;    fprintf(stderr, "## Watching thing %p.\n", a);