summaryrefslogtreecommitdiff
path: root/lib/hash.h
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2017-02-08 14:34:48 +0100
committerOndrej Zajicek (work) <santiago@crfreenet.org>2017-02-08 14:34:48 +0100
commitc259669fa33ca13b5c6ae60eb8ffa0874ddc01b2 (patch)
tree09003c2fa4d614b1e4f1fb10d16fba21acb56b4d /lib/hash.h
parent82f42ea09176afdb67ab119258d714e8c8e54d12 (diff)
parentda65a3d898fde0ce567782d86919a66e29916ed7 (diff)
Merge branch 'master' into int-new
Diffstat (limited to 'lib/hash.h')
-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); \