pike.git / src / gc.c

version» Context lines:

pike.git/src/gc.c:18:   #include "error.h"   #include "pike_memory.h"   #include "pike_macros.h"   #include "pike_types.h"   #include "time_stuff.h"      #include "gc.h"   #include "main.h"   #include <math.h>    - RCSID("$Id: gc.c,v 1.33 1998/04/10 04:37:38 hubbe Exp $"); + RCSID("$Id: gc.c,v 1.34 1998/04/10 04:48: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:94:   }      static struct marker **hash=0;   static unsigned long hashsize=0;      static struct marker *getmark(void *a)   {    unsigned long hashval;    struct marker *m;    -  hashval=((unsigned long)a)%hashsize; +  hashval=(unsigned long)a; +  hashval%=hashsize;    -  + #ifdef DEBUG +  if(hashval >= hashsize) +  fatal("Compiler has buggy modulo operator.\n"); + #endif +     for(m=hash[hashval];m;m=m->next)    if(m->marked == a)    return m;       m=new_marker();    m->marked=a;    m->refs=0;   #ifdef DEBUG    m->xrefs=0;   #endif