summaryrefslogtreecommitdiff
path: root/lib/hash.h
diff options
context:
space:
mode:
authorJan Moskyto Matejka <mq@ucw.cz>2017-02-22 11:58:04 +0100
committerJan Moskyto Matejka <mq@ucw.cz>2017-02-22 11:58:04 +0100
commitc609d039860f97f400d2cf0e9ca2b4e87b3fd1cc (patch)
tree6141291f6d6fbc0a90320f39c01bde49a119eadf /lib/hash.h
parent62e64905b76b88da72c522eac9276a74f60c9592 (diff)
parent2be9218a3b1dfcc8e42c8d118e95f2074d9f7a7c (diff)
Merge branch 'int-new' into nexthop-merged
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); \