Wireshark-commits: [Wireshark-commits] master 9ba4c6e: Hash map implementation for wmem.
From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Wed, 23 Apr 2014 12:42:27 +0000 (UTC)
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=9ba4c6e0916a9a40885827864da6353e1572e3b6
Submitter: Evan Huus (eapache@xxxxxxxxx)
Changed: branch: master
Repository: wireshark

Commits:

9ba4c6e by Evan Huus (eapache@xxxxxxxxx):

    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@xxxxxxxxx>
    

Actions performed:

    from  268104a   CaptureDialog: Fix IF type for user created pipe
    adds  9ba4c6e   Hash map implementation for wmem.


Summary of changes:
 epan/CMakeLists.txt                                |    1 +
 epan/wmem/Makefile.common                          |    3 +
 epan/wmem/wmem.h                                   |    1 +
 epan/wmem/wmem_core.c                              |    2 +
 epan/wmem/wmem_map.c                               |  284 ++++++++++++++++++++
 epan/wmem/wmem_map.h                               |  161 +++++++++++
 .../{wmem_allocator_simple.h => wmem_map_int.h}    |   17 +-
 epan/wmem/wmem_test.c                              |   61 ++++-
 8 files changed, 519 insertions(+), 11 deletions(-)
 create mode 100644 epan/wmem/wmem_map.c
 create mode 100644 epan/wmem/wmem_map.h
 copy epan/wmem/{wmem_allocator_simple.h => wmem_map_int.h} (78%)