/* LOCK THE ENTIRE HASH TABLE */
#include "prelookup.h"
+extern objstr_t *prefetchcache;
prehashtable_t pflookup; //Global prefetch cache table
printf("Calloc error %s %d\n", __FILE__, __LINE__);
return 1;
}
-
+ pflookup.hack=NULL;
+ pflookup.hack2=NULL;
pflookup.table = nodes;
pflookup.size = size;
pflookup.numelements = 0; // Initial number of elements in the hash
int i, isFirstBin;
prehashlistnode_t *ptr, *prev, *curr;
+ objstr_t *oldcache=prefetchcache;
+ prefetchcache=objstrCreate(prefetchcache->size);
+
pthread_mutex_lock(&pflookup.lock);
ptr = pflookup.table;
for(i = 0; i < pflookup.size; i++) {
}
}
pthread_mutex_unlock(&pflookup.lock);
+
+ if (pflookup.hack2!=NULL) {
+ objstrDelete(pflookup.hack2);
+ }
+ pflookup.hack2=pflookup.hack;
+ pflookup.hack=oldcache;
}