#include <ccan/hash/hash.h>
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <time.h>
#include <unistd.h>
#include <sys/time.h>
return hashl(key, 1, 0);
}
-static bool cmp(const unsigned int *key1, const unsigned int *key2)
+static bool cmp(const struct object *object, const unsigned int *key)
{
- return *key1 == *key2;
+ return object->key == *key;
}
HTABLE_DEFINE_TYPE(struct object, objkey, hash_obj, cmp, obj);
fflush(stdout);
gettimeofday(&start, NULL);
for (i = 0; i < num; i++) {
- unsigned int n = num * 6 + i * 9;
+ unsigned int n = num * (5 + 9) + i * 9;
if (htable_obj_get(ht, &n))
abort();
}