diff options
author | Johnny Richard <johnny@johnnyrichard.com> | 2023-05-17 18:06:12 +0200 |
---|---|---|
committer | Carlos Maniero <carlos@maniero.me> | 2023-05-18 19:08:02 -0300 |
commit | 89fe36162221ab36c5f2dfec1446dc406c68272b (patch) | |
tree | 89849408328a6026af1a140109b73b23b6c65027 /test/Makefile | |
parent | 15196aa56339d34af9f74b019e6aeff5816e8dcc (diff) |
This path implements a hashmap data structure using the FNV-1a hashing
function of 32 bits. However, there are a few limitations to consider:
a) The table does not automatically expand when it becomes too large.
b) The capacity of the hashmap must be a power of 2 to optimize
performance, as we utilize bitwise shifting instead of modulus
calculations.
c) Currently, there are no functions available to destroy hashmap
entries.
Collisions are handled using a linked list, which is not the most
optimal solution in terms of performance. However, it serves our current
needs adequately.
Signed-off-by: Johnny Richard <johnny@johnnyrichard.com>
Diffstat (limited to 'test/Makefile')
-rw-r--r-- | test/Makefile | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/Makefile b/test/Makefile index 6bdec12..88a8481 100644 --- a/test/Makefile +++ b/test/Makefile @@ -31,6 +31,9 @@ vector_test: munit.o ../build/vector.o vector_test.o list_test: munit.o ../build/list.o list_test.o $(CC) $? $(CFLAGS) -o $@ +hashmap_test: munit.o ../build/hashmap.o hashmap_test.o + $(CC) $? $(CFLAGS) -o $@ + lexer_test: munit.o ../build/string_view.o ../build/lexer.o lexer_test.o $(CC) $? $(CFLAGS) -o $@ |