-
Notifications
You must be signed in to change notification settings - Fork 18k
runtime: makemap should treat the size parameter as a hint and not panic if it's too big #19926
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
Comments
I would be happy to make the changes too. |
/cc @randall77 @josharian |
Sure, contributions welcome @gruszczy. Thanks. |
SGTM. Please add khr and josharian as reviewers on the CL. |
@gruszczy also, feel free to ask implementation questions here if you need any pointers. If you haven't already discovered this, you'll want to look at runtime/hashmap.go, func makemap, pretty near the beginning of the function. |
CL https://golang.org/cl/40854 mentions this issue. |
This came up during work on https://go-review.googlesource.com/c/40113/. Currently when the hashmap receives a size hint it can't use (for example because it's too big), it panics. Instead, it should treat purely as a hint about the required size and adjust it to what is possible.
The text was updated successfully, but these errors were encountered: