[esan] Add generic resizing hashtable
authorDerek Bruening <bruening@google.com>
Mon, 8 Aug 2016 17:25:40 +0000 (17:25 +0000)
committerDerek Bruening <bruening@google.com>
Mon, 8 Aug 2016 17:25:40 +0000 (17:25 +0000)
commit84df6be883d2a930a7c6227b8ea3f095ec11b5ac
tree1260a7a2d74236ed95eca64923b89855fc099d5e
parent75de8968b6252611a2319136342cd3b35eac2f85
[esan] Add generic resizing hashtable

Summary:
Adds a new, generic, resizing hashtable data structure for use by esan
tools.  No existing sanitizer hashtable is suitable for the use case for
most esan tools: we need non-fixed-size tables, parameterized keys and
payloads, and write access to payloads.  The new hashtable uses either
simple internal or external mutex locking and supports custom hash and
comparision operators.  The focus is on functionality, not performance, to
catalyze creation of a variety of tools.  We can optimize the more
successful tools later.

Adds tests of the data structure.

Reviewers: aizatsky

Subscribers: vitalybuka, zhaoqin, kcc, eugenis, llvm-commits, kubabrecka

Differential Revision: https://reviews.llvm.org/D22681

llvm-svn: 278024
compiler-rt/lib/esan/esan_hashtable.h [new file with mode: 0644]
compiler-rt/test/esan/Unit/hashtable.cpp [new file with mode: 0644]