You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Difference with Fiddle::Pointer#ref and FFI backend #182
Hi, with the C backend, the code below updates ptr in-place. However, with the FFI backend, ptr is unchanged (with both JRuby and TruffleRuby).
require"fiddle"ptr=Fiddle::Pointer["hello"]i=ptr.to_iptr.ref[0,Fiddle::SIZEOF_VOIDP]=Fiddle::Pointer["world"]pptr.to_i == i# false for C backend, true for FFI backend
I'm having trouble finding the cause (to try to make the behavior consistent), so wanted to see if anyone had ideas.
changed the title [-]Difference with `Fiddle::Pointer.ref` and FFI backend[/-][+]Difference with `Fiddle::Pointer#ref` and FFI backend[/+]on Apr 22, 2025
Activity
[-]Difference with `Fiddle::Pointer.ref` and FFI backend[/-][+]Difference with `Fiddle::Pointer#ref` and FFI backend[/+]kou commentedon Apr 22, 2025
In general, the C backend is the referenced implementation. So we should fix the FFI backend.
ankane commentedon Apr 22, 2025
Submitted a PR in #185.
Fix `Fiddle::Pointer#ref` behavior for FFI backend (#185)