class FFI::Struct::ManagedStructConverter

def from_native(ptr, ctx)

Returns:
  • (Struct) -

Parameters:
  • ctx (nil) --
  • ptr (Pointer) --
def from_native(ptr, ctx)
  struct_class.new(AutoPointer.new(ptr, @method))
end

def initialize(struct_class)

Parameters:
  • struct_class (Struct) --
def initialize(struct_class)
  super(struct_class)
  raise NoMethodError, "release() not implemented for class #{struct_class}" unless struct_class.respond_to? :release
  @method = struct_class.method(:release)
end