Skip to content
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

Fix map loop #890

Merged
merged 9 commits into from
Jan 5, 2016
Merged

Fix map loop #890

merged 9 commits into from
Jan 5, 2016

Conversation

madafoo
Copy link
Contributor

@madafoo madafoo commented Dec 7, 2015

Stupid typo cause put map value hash2 function not equal with indexForKey map hash2 function.
Also add missing map fuzzing testing.

@wfleurant
Copy link
Contributor

Fixes #889 for me.

@cjdelisle cjdelisle merged commit 7625296 into cjdelisle:crashey Jan 5, 2016
@cjdelisle
Copy link
Owner

This is fucking impossible. I merged it and then found that it infiniloops any time I start cjdns without any peers, how can you miss this? I looked at the loop and there's really no way of understanding how it ought to finish, no assertions or anything in case it runs over a certain limit, it looks like you were just 100% sure of your code.
If you want to make a faster Map.h, please make a Map2.h which has the same sort of API as ArrayList.h (doesn't attempt to store the keys and values IN the map's memory), then make a Map2.c which uses the red/black tree that's used in NodeStore because this is known to work. Then write a test which is NOT the slowest test in the test set (when --fuzz is not passed), THEN talk to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants