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

uintptr_t is wrong size on 64-bit JRuby #2293

Closed
djberg96 opened this issue Dec 9, 2014 · 1 comment
Closed

uintptr_t is wrong size on 64-bit JRuby #2293

djberg96 opened this issue Dec 9, 2014 · 1 comment

Comments

@djberg96
Copy link
Contributor

@djberg96 djberg96 commented Dec 9, 2014

Also posted here: ffi/ffi#396

I noticed that a 64-bit JRuby is handling :uintptr_t incorrectly. It should give me an 8 byte pointer, but I'm getting a 4 byte pointer instead:

#64-bit MRI returns 8, but a 64-bit JRuby returns 4
FFI::MemoryPointer.new(:uintptr_t).size

My workaround for now is this:

if RUBY_PLATFORM == 'java' && ENV_JAVA['sun.arch.data.model'] == '64'
  :ulong_long
else
  :uintptr_t
end
@jsvd
Copy link

@jsvd jsvd commented May 20, 2015

this is related to #1718

@headius headius closed this in 6fc0135 May 26, 2015
headius added a commit that referenced this issue May 26, 2015
@headius headius added this to the JRuby 1.7.21 milestone May 26, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.