diff options
| author | chenzizhan <[email protected]> | 2023-07-20 15:26:03 +0800 |
|---|---|---|
| committer | chenzizhan <[email protected]> | 2023-07-20 15:26:03 +0800 |
| commit | beefb3a3538c1d1c47eb4913c544ad7ed9f0d639 (patch) | |
| tree | 6b834d0a4c60fe1ba933cc4b76573aae2b4fad0a /vendors | |
| parent | 7b02d066d682da131874c68c97ed88af9cc69fa2 (diff) | |
fix bugs, tag hashing test
Diffstat (limited to 'vendors')
| -rw-r--r-- | vendors/uthash.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/vendors/uthash.h b/vendors/uthash.h index 2c00932..e6b2617 100644 --- a/vendors/uthash.h +++ b/vendors/uthash.h @@ -29,6 +29,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include <string.h> /* memcmp, memset, strlen */ #include <stddef.h> /* ptrdiff_t */ #include <stdlib.h> /* exit */ +#include <stdio.h> // todo: remove this line #if defined(HASH_DEFINE_OWN_STDINT) && HASH_DEFINE_OWN_STDINT /* This codepath is provided for backward compatibility, but I plan to remove it. */ @@ -161,10 +162,12 @@ do { #define HASH_FIND_BYHASHVALUE(hh,head,keyptr,keylen,hashval,out) \ do { \ (out) = NULL; \ + printf("in HASH_FIND_BYHASHVALUE\n"); \ if (head) { \ unsigned _hf_bkt; \ HASH_TO_BKT(hashval, (head)->hh.tbl->num_buckets, _hf_bkt); \ if (HASH_BLOOM_TEST((head)->hh.tbl, hashval) != 0) { \ + printf("Bloom filter hit\n"); \ HASH_FIND_IN_BKT((head)->hh.tbl, hh, (head)->hh.tbl->buckets[ _hf_bkt ], keyptr, keylen, hashval, out); \ } \ } \ @@ -438,6 +441,7 @@ do { #define HASH_TO_BKT(hashv,num_bkts,bkt) \ do { \ bkt = ((hashv) & ((num_bkts) - 1U)); \ + printf("in HASH_TO_BKT\n"); \ } while (0) /* delete "delptr" from the hash table. @@ -754,12 +758,15 @@ do { do { \ if ((head).hh_head != NULL) { \ DECLTYPE_ASSIGN(out, ELMT_FROM_HH(tbl, (head).hh_head)); \ + printf("hh head not NULL, out: %p\n", out); \ } else { \ + printf("hh head NULL, output NULL\n"); \ (out) = NULL; \ } \ while ((out) != NULL) { \ if ((out)->hh.hashv == (hashval) && (out)->hh.keylen == (keylen_in)) { \ if (HASH_KEYCMP((out)->hh.key, keyptr, keylen_in) == 0) { \ + printf("directly find one\n"); \ break; \ } \ } \ |
