Skip to content

Refactor and fix allocFirst with buckets for RubyHash#5278

Merged
eregon merged 8 commits intojruby:masterfrom
ChrisBr:refactoring/hash
Aug 28, 2018
Merged

Refactor and fix allocFirst with buckets for RubyHash#5278
eregon merged 8 commits intojruby:masterfrom
ChrisBr:refactoring/hash

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.

@kares kares added this to the JRuby 9.2.1.0 milestone Aug 21, 2018
@kares kares added the internal label Aug 21, 2018
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 :)

}
}

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