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

std: hash_map: Better handling of no available slots case #7472

Closed
wants to merge 3 commits into from

Conversation

LemonBoy
Copy link
Contributor

Whenever self.available reaches zero we're not allowed to use free
slots, enforce this constraint while looking for a usable one.

Closes #7468

We need a test case that's independent of the hash function being used, I'll see if I can come up with something nice later.

Whenever self.available reaches zero we're not allowed to use free
slots, enforce this constraint while looking for a usable one.

Closes ziglang#7468
@LemonBoy
Copy link
Contributor Author

So... what the fuck is wrong with the Windows CI? Both this and #7447 are failing due to some OOM error that I don't see on master...

Keep scanning the whole set of slots and exit when we've reached the
starting index. At that point if we don't have a free (!isUsed) slot it
means we've overshot the maximum capacity.

Closes ziglang#7494
@Sahnvour
Copy link
Contributor

@LemonBoy Please see my answer in #7468 and let me know what you think, I currently think this it not the good way to fix the problem. I don't have time to look at it in depth at the moment however 😦

@LemonBoy
Copy link
Contributor Author

Yes, in #7494 I was wondering if this was just be a documentation problem.
TBH the assumeCapacity naming is a bit misleading as there's an hidden dependence on the load factor.

@Vexu Vexu added the standard library This issue involves writing Zig code for the standard library. label Dec 25, 2020
@LemonBoy LemonBoy closed this Dec 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
standard library This issue involves writing Zig code for the standard library.
Projects
None yet
3 participants