-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hashmap implementation #46
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two small-ish things:
For consistency, could we name the structs HashNode
and HashMap
And could you add a test file for this?
But aside from that, looks good!
All of this has been added (and a bunch of files header's lightly modified... sorry about that) |
I get an error when building.
|
void *value = (void *)128; | ||
|
||
hm_set(table, key, value); | ||
tassert(hm_lookup(table, key) == (void *)128); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may also want to change this to something like
tassert(*(int*)hm_lookup(table, key) == 128);
When I added --- a/src/util/test_hash.c
+++ b/src/util/test_hash.c
@@ -10,6 +10,7 @@ int test_hash() {
test_hashing();
test_init_and_free();
+ test_minimal_case();
test_100_inserts();
test_100_removes(); When it's run, it segfaults, Running "test_hashing"
Running "test_init_and_free"
Running "test_minimal_case"
Warning: jccc: hashmap full!
Segmentation fault (core dumped) |
Closing due to inactivity. |
should close issue #15