Skip to content

Replace Unsafe byte[] long-walking with VarHandle#8508

Merged
headius merged 3 commits intojruby:10-devfrom
headius:no_unsafe_for_long_walk
Dec 11, 2024
Merged

Replace Unsafe byte[] long-walking with VarHandle#8508
headius merged 3 commits intojruby:10-devfrom
headius:no_unsafe_for_long_walk

Conversation

@headius
Copy link
Member

@headius headius commented Dec 11, 2024

Fixes #8507

@headius headius added this to the JRuby 10.0.0.0 milestone Dec 11, 2024
@headius headius marked this pull request as ready for review December 11, 2024 02:37
@headius
Copy link
Member Author

headius commented Dec 11, 2024

Also using this PR to remove other uses of Unsafe. The varTable management was simple enough. Two uses remain that require a bit more work:

  • NonBlockingHashMapLong uses Unsafe to directly access arrays and fields.
  • SipHashInline uses Unsafe for wide-stride byte[] walking.

@headius
Copy link
Member Author

headius commented Dec 11, 2024

SipHashInline is done.

This switches all RubyBasicObject.varTable management away from
Unsafe and toward the equivalent VarHandle forms.
@headius headius force-pushed the no_unsafe_for_long_walk branch from cef1ee9 to e1ee3b7 Compare December 11, 2024 03:24
@headius headius linked an issue Dec 11, 2024 that may be closed by this pull request
@headius headius merged commit 0e86f76 into jruby:10-dev Dec 11, 2024
47 of 72 checks passed
@headius headius deleted the no_unsafe_for_long_walk branch December 11, 2024 04:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Eliminate use of unsafe in StringSupport

1 participant