@JRubyMethod(required = 4) public IRubyObject initialize(ThreadContext context, IRubyObject[] args) { if (!(args[2] instanceof MappedType)) { throw context.runtime.newTypeError(args[2], context.runtime.getModule("FFI").getClass("Type").getClass("Mapped")); } if (!(args[3] instanceof Field)) { throw context.runtime.newTypeError(args[3], context.runtime.getModule("FFI").getClass("StructLayout").getClass("Field")); } init(args[0], args[2], args[1], new MappedFieldIO((MappedType) args[2], ((Field) args[3]).getFieldIO())); return this; } }
public void put(ThreadContext context, Storage cache, Member m, AbstractMemory ptr, IRubyObject value) { final IRubyObject nativeValue = mappedType.toNative(context, value); nativeFieldIO.put(context, cache, m, ptr, nativeValue); if (isValueReferenceNeeded()) { // keep references to both the ruby and native values to preserve // reference chains cache.putReference(m, new Object[] { value, nativeValue }); } } }
@JRubyMethod(required = 4) public IRubyObject initialize(ThreadContext context, IRubyObject[] args) { if (!(args[2] instanceof MappedType)) { throw context.runtime.newTypeError(args[2], context.runtime.getModule("FFI").getClass("Type").getClass("Mapped")); } if (!(args[3] instanceof Field)) { throw context.runtime.newTypeError(args[3], context.runtime.getModule("FFI").getClass("StructLayout").getClass("Field")); } init(args[0], args[2], args[1], new MappedFieldIO((MappedType) args[2], ((Field) args[3]).getFieldIO())); return this; } }
@JRubyMethod(required = 4, visibility = PRIVATE) public IRubyObject initialize(ThreadContext context, IRubyObject[] args) { if (!(args[2] instanceof MappedType)) { throw context.runtime.newTypeError(args[2], context.runtime.getModule("FFI").getClass("Type").getClass("Mapped")); } if (!(args[3] instanceof Field)) { throw context.runtime.newTypeError(args[3], context.runtime.getModule("FFI").getClass("StructLayout").getClass("Field")); } init(args[0], args[2], args[1], new MappedFieldIO((MappedType) args[2], ((Field) args[3]).getFieldIO())); return this; } }
@JRubyMethod(required = 4, visibility = PRIVATE) public IRubyObject initialize(ThreadContext context, IRubyObject[] args) { if (!(args[2] instanceof MappedType)) { throw context.runtime.newTypeError(args[2], context.runtime.getModule("FFI").getClass("Type").getClass("Mapped")); } if (!(args[3] instanceof Field)) { throw context.runtime.newTypeError(args[3], context.runtime.getModule("FFI").getClass("StructLayout").getClass("Field")); } init(args[0], args[2], args[1], new MappedFieldIO((MappedType) args[2], ((Field) args[3]).getFieldIO())); return this; } }
public void put(ThreadContext context, Storage cache, Member m, AbstractMemory ptr, IRubyObject value) { final IRubyObject nativeValue = mappedType.toNative(context, value); nativeFieldIO.put(context, cache, m, ptr, nativeValue); if (isValueReferenceNeeded()) { // keep references to both the ruby and native values to preserve // reference chains cache.putReference(m, new Object[] { value, nativeValue }); } } }
public void put(ThreadContext context, Storage cache, Member m, AbstractMemory ptr, IRubyObject value) { final IRubyObject nativeValue = mappedType.toNative(context, value); nativeFieldIO.put(context, cache, m, ptr, nativeValue); if (isValueReferenceNeeded()) { // keep references to both the ruby and native values to preserve // reference chains cache.putReference(m, new Object[] { value, nativeValue }); } } }
public void put(ThreadContext context, Storage cache, Member m, AbstractMemory ptr, IRubyObject value) { final IRubyObject nativeValue = mappedType.toNative(context, value); nativeFieldIO.put(context, cache, m, ptr, nativeValue); if (isValueReferenceNeeded()) { // keep references to both the ruby and native values to preserve // reference chains cache.putReference(m, new Object[] { value, nativeValue }); } } }