#include #include "m.h" #define hhsize 1024 typedef struct mgg{b32 ino; struct mgg * next;} zot; static zot * hh[hhsize]; typedef struct mgh{struct mgh * next; zot a[2000];} segm; static segm * segp = 0; int New(b32 C i){ static int hwat=2000; b16 h = ((i ^ i>>16)>>5)&(hhsize-1); {zot * * p = &hh[h]; while(*p && (*p)->ino != i) p = &(*p)->next; if(!*p){if(hwat==2000) {segm * ns = (segm *)core(sizeof(segm), "link hash"); fprintf(out,cen("H:2000 hard linked files.\n")); ns->next = segp; segp = ns; hwat=0;} {zot * zp = segp->a+hwat++; zp->ino=i; zp->next = *p; *p = zp;} return 1;} else return 0;}} extern long seed; long Rnd(void); void open_p(){int i; for(i=0; inext; free(segp); segp=x;}} #if 0 int main(){seed=1; initp(); {b32 i; for(i=0; i<200000; ++i) {b32 j = Rnd(); if(probe(j))fprintf(out,"%08lx %08lx\n", i, j);}} seed=1; {b32 i; for(i=0; i<200002; ++i) {b32 j = Rnd(); if(!probe(j)) fprintf(out,"X%08lx %08lx\n", i, j);}}} #endif