summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/hash.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/hash.h b/lib/hash.h
index b37d8fa5..97d8f69c 100644
--- a/lib/hash.h
+++ b/lib/hash.h
@@ -25,6 +25,12 @@
(v).data = mb_allocz(pool, HASH_SIZE(v) * sizeof(* (v).data)); \
})
+#define HASH_FREE(v) \
+ ({ \
+ mb_free((v).data); \
+ (v) = (typeof(v)){ }; \
+ })
+
#define HASH_FIND(v,id,key...) \
({ \
u32 _h = HASH_FN(v, id, key); \