[all-commits] [llvm/llvm-project] b510cd: [ADT] Add TrieRawHashMap (#69528)

Steven Wu via All-commits all-commits at lists.llvm.org
Tue Oct 29 10:30:01 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b510cdb895b9188e5819c4c85a6dab22a4d14385
      https://github.com/llvm/llvm-project/commit/b510cdb895b9188e5819c4c85a6dab22a4d14385
  Author: Steven Wu <stevenwu at apple.com>
  Date:   2024-10-29 (Tue, 29 Oct 2024)

  Changed paths:
    A llvm/include/llvm/ADT/TrieHashIndexGenerator.h
    A llvm/include/llvm/ADT/TrieRawHashMap.h
    M llvm/lib/Support/CMakeLists.txt
    A llvm/lib/Support/TrieRawHashMap.cpp
    M llvm/unittests/ADT/CMakeLists.txt
    A llvm/unittests/ADT/TrieRawHashMapTest.cpp

  Log Message:
  -----------
  [ADT] Add TrieRawHashMap (#69528)

Implement TrieRawHashMap can be used to store object with its associated
hash. User needs to supply a strong hashing function to guarantee the
uniqueness of the hash of the objects to be inserted. A hash collision
is not supported and will lead to error or failed to insert.

TrieRawHashMap is thread-safe and lock-free and can be used as
foundation data structure to implement a content addressible storage.
TrieRawHashMap owns the data stored in it and is designed to be:
* Fast to lookup.
* Fast to "insert" if the data has already been inserted.
* Can be used without lock and doesn't require any knowledge of the
participating threads or extra coordination between threads.

It is not currently designed to be used to insert unique new data with
high contention, due to the limitation on the memory allocator.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list