pike.git / src / debug.c

version» Context lines:

pike.git/src/debug.c:1:   #include "global.h"   #include "types.h" + #include "memory.h"      #define MARKER_CHUNK_SIZE 4096   #define REHASH_LIMIT 16   #define REHASH_FORMULA(X) ((X)*4-1)      struct marker   {    struct marker *next;    void *marked;    INT32 refs;
pike.git/src/debug.c:40:   static int hashsize=0;   static int hashed=0;      INT32 checked(void *a,INT32 delta)   {    int hashval;    struct marker *m;       if(!hash) return 0;    -  hashval=((int)a)%hashsize; +  hashval=((long)a)%hashsize;       for(m=hash[hashval];m;m=m->next)    {    if(m->marked == a)    {    m->refs+=delta;    return m->refs;    }    }    if(!delta) return 0;
pike.git/src/debug.c:74:       new_hashsize=REHASH_FORMULA(hashsize);    new_hash=(struct marker **)xalloc(sizeof(struct marker **)*new_hashsize);    memset((char *)new_hash,0,sizeof(struct marker **)*new_hashsize);       for(e=0;e<hashsize;e++)    {    for(m=hash[e];m;m=next)    {    next=m->next; -  m->next=new_hash[((int)m->marked)%new_hashsize]; +  m->next=new_hash[((long)m->marked)%new_hashsize];    new_hash[((int)m->marked)%new_hashsize]=m;    }    }       free((char *)hash);    hash=new_hash;    hashsize=new_hashsize;    }       return m->refs;