Skip to content

Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →

class method

Fiddle.dlwrap

Fiddle.dlwrap(val)

Returns the memory address of the Ruby object stored at val

Example:

Example
x = Object.new
# => #<Object:0x0000000107c7d870>
Fiddle.dlwrap(x)
# => 4425504880

In the case val is not a heap allocated object, this method will return the tagged pointer value.

Example:

Example
Fiddle.dlwrap(123)
# => 247
See also .dlunwrap .free .dlopen .last_error also in 3.4 · 3.2 · 3.1 · 3.0