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.48 2000/02/22 21:28:52 hubbe Exp $"); + RCSID("$Id: gc.c,v 1.49 2000/03/07 21:23:41 hubbe Exp $");      /* Run garbage collect approximate every time we have    * 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:229: Inside #if defined(PIKE_DEBUG)
  {    int ret;    found_in=data;    found_in_type=t;    ret=gc_check(x);    found_in_type=T_UNKNOWN;    found_in=0;    return ret;   }    - void describe_something(void *a, int t, int dm) + void low_describe_something(void *a, int t, int dm)   {    struct program *p=(struct program *)a; -  if(!a) return; +     - #ifdef DEBUG_MALLOC -  if(dm) -  debug_malloc_dump_references(a); - #endif -  -  if(t==-1) -  { -  fprintf(stderr,"**Location description: %s\n",(char *)a); -  return; -  } -  -  fprintf(stderr,"**Location: %p Type: %s Refs: %d\n",a, -  get_name_of_type(t), -  *(INT32 *)a); -  +     switch(t)    {    case T_FUNCTION:    if(attempt_to_identify(a) != T_OBJECT)    {    fprintf(stderr,"**Builtin function!\n");    break;    }       case T_OBJECT:
pike.git/src/gc.c:351:    fprintf(stderr,"**String length is %d:\n",s->len);    if(s->len>77)    {    fprintf(stderr,"** \"%60s ...\"\n",s->str);    }else{    fprintf(stderr,"** \"%s\"\n",s->str);    }    break;    }    } + } +  + void describe_something(void *a, int t, int dm) + { +  struct program *p=(struct program *)a; +  if(!a) return; +  +  if(t==-1) +  { +  fprintf(stderr,"**Location description: %s\n",(char *)a); +  return; +  } +  +  fprintf(stderr,"**Location: %p Type: %s Refs: %d\n",a, +  get_name_of_type(t), +  *(INT32 *)a); +  +  low_describe_something(a,t,dm); +  + #ifdef DEBUG_MALLOC +  if(dm) +  debug_malloc_dump_references(a); + #endif +  +     fprintf(stderr,"*******************\n");   }      void describe(void *x)   {    describe_something(x, attempt_to_identify(x),1);   }      void debug_describe_svalue(struct svalue *s)   {