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.114 2000/08/10 09:25:44 grubba Exp $"); + RCSID("$Id: gc.c,v 1.115 2000/08/10 13:34:36 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:311:   #endif       if(type==T_UNKNOWN)    type=attempt_to_identify(memblock);       if(memblock)    fprintf(stderr,"%*s-> from %s %p offset %ld\n",    indent,"",    get_name_of_type(type),    memblock, -  ((long)location - (long)memblock)); +  (long)((char *)location - (char *)memblock));    else    fprintf(stderr,"%*s-> at location %p in unknown memblock (mmaped?)\n",    indent,"",    location);          if(memblock && depth>0)    describe_something(memblock,type,indent+2,depth-1,flags | DESCRIBE_MEM);       again:
pike.git/src/gc.c:353:    p=(struct program *)memblock;       if(location == (void *)&p->prev)    fprintf(stderr,"%*s **In p->prev\n",indent,"");       if(location == (void *)&p->next)    fprintf(stderr,"%*s **In p->next\n",indent,"");       if(p->inherits &&    ptr >= (char *)p->inherits && -  ptr<(char*)(p->inherits+p->num_inherits)) +  ptr < (char*)(p->inherits+p->num_inherits))    { -  e=((ptrdiff_t)ptr - (ptrdiff_t)(p->inherits)) / sizeof(struct inherit); +  e=((char *)ptr - (char *)(p->inherits)) / sizeof(struct inherit);    fprintf(stderr,"%*s **In p->inherits[%ld] (%s)\n",indent,"",    e,    p->inherits[e].name ? p->inherits[e].name->str : "no name");    break;    }       if(p->constants &&    ptr >= (char *)p->constants && -  ptr<(char*)(p->constants+p->num_constants)) +  ptr < (char*)(p->constants+p->num_constants))    { -  e=((ptrdiff_t)ptr - (ptrdiff_t)(p->constants)) / +  e = ((char *)ptr - (char *)(p->constants)) /    sizeof(struct program_constant);    fprintf(stderr,"%*s **In p->constants[%ld] (%s)\n",indent,"",    e,    p->constants[e].name ? p->constants[e].name->str : "no name");    break;    }          if(p->identifiers &&    ptr >= (char *)p->identifiers && -  ptr<(char*)(p->identifiers+p->num_identifiers)) +  ptr < (char*)(p->identifiers+p->num_identifiers))    { -  e=((ptrdiff_t)ptr - (ptrdiff_t)(p->identifiers)) / +  e = ((char *)ptr - (char *)(p->identifiers)) /    sizeof(struct identifier);    fprintf(stderr,"%*s **In p->identifiers[%ld] (%s)\n",indent,"",    e,    p->identifiers[e].name ? p->identifiers[e].name->str : "no name");    break;    }      #define FOO(NTYP,TYP,NAME) \    if(location == (void *)&p->NAME) fprintf(stderr,"%*s **In p->" #NAME "\n",indent,""); \    if(ptr >= (char *)p->NAME && ptr<(char*)(p->NAME+p->PIKE_CONCAT(num_,NAME))) \