class FFI::StrPtrConverter

It’s {typedef}‘d as :strptr.
library handed the memory to off to the caller (Ruby-FFI).
to the data for you to do something with it, like freeing it, in case the
a Ruby string already containing a copy of the data, but also the pointer
also allow to work with the pointer itself. This is useful when you want
This will convert a pointer to a Ruby string (just like `:string`), but

def self.from_native(val, ctx)

Returns:
  • (Array(String, Pointer)) -

Parameters:
  • ctx () -- not used
  • val (Pointer) --
def self.from_native(val, ctx)
  [ val.null? ? nil : val.get_string(0), val ]
end