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

Refactor and fix allocFirst with buckets for RubyHash #5278

Merged
merged 8 commits into from
Aug 28, 2018

Conversation

ChrisBr
Copy link
Contributor

@ChrisBr ChrisBr commented Aug 7, 2018

No description provided.

@enebo
Copy link
Member

enebo commented Aug 7, 2018

@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?

@ChrisBr
Copy link
Contributor Author

ChrisBr commented Aug 8, 2018

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

@ChrisBr
Copy link
Contributor Author

ChrisBr commented Aug 9, 2018

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.

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 make updateStartAndEndPointer 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.
Copy link
Member

@eregon eregon left a 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) {
Copy link
Contributor

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

@eregon
Copy link
Member

eregon commented Aug 28, 2018

Let's merge this, CI is green (except just one failure of ruby/spec which I will tag).

@eregon eregon merged commit 0aef1ec into jruby:master Aug 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants