-
-
Notifications
You must be signed in to change notification settings - Fork 924
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
Refactor and fix allocFirst with buckets for RubyHash #5278
Conversation
@ChrisBr This all looked good at a glance but there are epic amounts of OOME in the travis build. Could that be related to these changes or is travis acting up? |
Likely 🤔 I will have a look at it tonight |
4b85450
to
8bcb10e
Compare
Ok, I dropped a few suspicious commits, let's see if this solves it. I will after this PR is merged subsequently create new PRs with the dropped commits. |
8bcb10e
to
49ce96e
Compare
to use the next biggest power of two for the hash size. This is necessary because otherwise the secondHashFunction might not be a generator and we do not iterate of all buckets. It is a requirement for the secondaryHash function that buckets length is a power of two.
to DRY the code.
to make updateStartAndEndPointer more readable.
to make code more readable.
it is not necessary to have an if/else we can just move the pointers up / down until we find an existing key.
49ce96e
to
6d44f80
Compare
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.
Fixes #5289 so seems good to me :)
Arrays.fill(bins, EMPTY_BIN); | ||
} | ||
} | ||
|
||
private final int nextPowOfTwo(final int i) { |
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.
for inspiration jemalloc/jemalloc#1303
Let's merge this, CI is green (except just one failure of ruby/spec which I will tag). |
No description provided.