aboutsummaryrefslogtreecommitdiffstats
path: root/epan/wmem/wmem_core.c
diff options
context:
space:
mode:
authorEvan Huus <eapache@gmail.com>2014-04-21 20:30:06 -0400
committerEvan Huus <eapache@gmail.com>2014-04-23 12:42:26 +0000
commit9ba4c6e0916a9a40885827864da6353e1572e3b6 (patch)
tree5d63f5cd97ceecacf6abc31533a5f663b881c0fd /epan/wmem/wmem_core.c
parent268104a1ddd476632b84008f33f70ec11cd95fc3 (diff)
Hash map implementation for wmem.
This has two expected uses: - Many current users of wmem_tree don't actually need the predecessor lookup it provides (the lookup_le function family). A hash map provides straight insertion and lookup much more efficiently than a wmem_tree when predecessor lookup isn't needed. - Many current users of glib's hash table and hash functions use untrusted data for keys, making them vulnerable to algorithmic complexity attacks. Care has been taken to make this implementation secure against such attacks, so it should be used whenever data is untrusted. In my benchmarks it is measurably slower than GHashTable, but not excessively so. Given the additional security it provides this seems like a reasonable trade-off (and it is still faster than a wmem_tree). Change-Id: I2d67a0d06029f14c153eaa42d5cfc774aefd9918 Reviewed-on: https://code.wireshark.org/review/1272 Reviewed-by: Evan Huus <eapache@gmail.com>
Diffstat (limited to 'epan/wmem/wmem_core.c')
-rw-r--r--epan/wmem/wmem_core.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/epan/wmem/wmem_core.c b/epan/wmem/wmem_core.c
index d6ff486579..bcec1f78ad 100644
--- a/epan/wmem/wmem_core.c
+++ b/epan/wmem/wmem_core.c
@@ -27,6 +27,7 @@
#include "wmem_core.h"
#include "wmem_scopes.h"
+#include "wmem_map_int.h"
#include "wmem_user_cb_int.h"
#include "wmem_allocator.h"
#include "wmem_allocator_simple.h"
@@ -206,6 +207,7 @@ wmem_init(void)
}
wmem_init_scopes();
+ wmem_init_hashing();
}
void