From 3afa6b2b3981841a6a7df988abe46460f20fa54d Mon Sep 17 00:00:00 2001 From: Samy Al Bahra Date: Sat, 11 Aug 2012 17:04:56 -0400 Subject: [PATCH] ck_ht: Let users define their own empty and tombstone values. --- include/ck_ht.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/include/ck_ht.h b/include/ck_ht.h index a0218e7..7fa6db7 100644 --- a/include/ck_ht.h +++ b/include/ck_ht.h @@ -66,8 +66,16 @@ struct ck_ht_entry { } CK_CC_ALIGNED; typedef struct ck_ht_entry ck_ht_entry_t; +/* + * The user is free to define their own stub values. + */ +#ifndef CK_HT_KEY_EMPTY #define CK_HT_KEY_EMPTY ((uintptr_t)0) -#define CK_HT_KEY_TOMBSTONE (~(uintptr_t)0) +#endif + +#ifndef CK_HT_KEY_TOMBSTONE +#define CK_HT_KEY_TOMBSTONE (~CK_HT_KEY_EMPTY) +#endif /* * Hash callback function. First argument is updated to contain a hash value,