public final void put(Ruby runtime, MemoryIO io, long offset, IRubyObject value) { io.putMemoryIO(offset, ((AbstractMemory) value).getMemoryIO()); }
public final void put(Ruby runtime, MemoryIO io, long offset, IRubyObject value) { io.putMemoryIO(offset, ((AbstractMemory) value).getMemoryIO()); }
public final void put(Ruby runtime, MemoryIO io, long offset, IRubyObject value) { io.putMemoryIO(offset, ((AbstractMemory) value).getMemoryIO()); }
public final void put(Ruby runtime, MemoryIO io, long offset, IRubyObject value) { io.putMemoryIO(offset, ((AbstractMemory) value).getMemoryIO()); }
private void putPointer(ThreadContext context, long offset, Pointer value) { MemoryIO ptr = value.getMemoryIO(); if (ptr.isDirect()) { getMemoryIO().putMemoryIO(offset, ptr); } else if (ptr.isNull()) { getMemoryIO().putAddress(offset, 0L); } else { throw context.runtime.newArgumentError("Cannot convert argument to pointer"); } }
private void putPointer(ThreadContext context, long offset, Pointer value) { MemoryIO ptr = value.getMemoryIO(); if (ptr.isDirect()) { getMemoryIO().putMemoryIO(offset, ptr); } else if (ptr.isNull()) { getMemoryIO().putAddress(offset, 0L); } else { throw context.runtime.newArgumentError("Cannot convert argument to pointer"); } }
private void putPointer(ThreadContext context, long offset, Pointer value) { MemoryIO ptr = value.getMemoryIO(); if (ptr.isDirect()) { getMemoryIO().putMemoryIO(offset, ptr); } else if (ptr.isNull()) { getMemoryIO().putAddress(offset, 0L); } else { throw context.runtime.newArgumentError("Cannot convert argument to pointer"); } }
private void putPointer(ThreadContext context, long offset, Pointer value) { MemoryIO ptr = value.getMemoryIO(); if (ptr.isDirect()) { getMemoryIO().putMemoryIO(offset, ptr); } else if (ptr.isNull()) { getMemoryIO().putAddress(offset, 0L); } else { throw context.runtime.newArgumentError("Cannot convert argument to pointer"); } }
@JRubyMethod(name = "put_callback", required = 3) public IRubyObject put_callback(ThreadContext context, IRubyObject offset, IRubyObject proc, IRubyObject cbInfo) { if (!(cbInfo instanceof CallbackInfo)) { throw context.runtime.newArgumentError("invalid CallbackInfo"); } Pointer ptr = Factory.getInstance().getCallbackManager().getCallback(context.runtime, (CallbackInfo) cbInfo, proc); getMemoryIO().putMemoryIO(getOffset(offset), ((AbstractMemory) ptr).getMemoryIO()); return this; }
@JRubyMethod(name = "put_callback", required = 3) public IRubyObject put_callback(ThreadContext context, IRubyObject offset, IRubyObject proc, IRubyObject cbInfo) { if (!(cbInfo instanceof CallbackInfo)) { throw context.runtime.newArgumentError("invalid CallbackInfo"); } Pointer ptr = Factory.getInstance().getCallbackManager().getCallback(context.runtime, (CallbackInfo) cbInfo, proc); getMemoryIO().putMemoryIO(getOffset(offset), ((AbstractMemory) ptr).getMemoryIO()); return this; }
@JRubyMethod(name = "put_callback", required = 3) public IRubyObject put_callback(ThreadContext context, IRubyObject offset, IRubyObject proc, IRubyObject cbInfo) { if (!(cbInfo instanceof CallbackInfo)) { throw context.runtime.newArgumentError("invalid CallbackInfo"); } Pointer ptr = Factory.getInstance().getCallbackManager().getCallback(context.runtime, (CallbackInfo) cbInfo, proc); getMemoryIO().putMemoryIO(getOffset(offset), ((AbstractMemory) ptr).getMemoryIO()); return this; }
@JRubyMethod(name = "put_callback", required = 3) public IRubyObject put_callback(ThreadContext context, IRubyObject offset, IRubyObject proc, IRubyObject cbInfo) { if (!(cbInfo instanceof CallbackInfo)) { throw context.runtime.newArgumentError("invalid CallbackInfo"); } Pointer ptr = Factory.getInstance().getCallbackManager().getCallback(context.runtime, (CallbackInfo) cbInfo, proc); getMemoryIO().putMemoryIO(getOffset(offset), ((AbstractMemory) ptr).getMemoryIO()); return this; }
public void put(ThreadContext context, Storage cache, Member m, AbstractMemory ptr, IRubyObject value) { if (value.isNil()) { ptr.getMemoryIO().putAddress(m.getOffset(ptr), 0L); cache.putReference(m, value); } else { Pointer cb = Factory.getInstance().getCallbackManager().getCallback(context.runtime, (CallbackInfo) m.type, value); ptr.getMemoryIO().putMemoryIO(m.getOffset(ptr), cb.getMemoryIO()); cache.putReference(m, cb); } }
public void put(ThreadContext context, Storage cache, Member m, AbstractMemory ptr, IRubyObject value) { if (value.isNil()) { ptr.getMemoryIO().putAddress(m.getOffset(ptr), 0L); cache.putReference(m, value); } else { Pointer cb = Factory.getInstance().getCallbackManager().getCallback(context.runtime, (CallbackInfo) m.type, value); ptr.getMemoryIO().putMemoryIO(m.getOffset(ptr), cb.getMemoryIO()); cache.putReference(m, cb); } }
public void put(ThreadContext context, Storage cache, Member m, AbstractMemory ptr, IRubyObject value) { if (value.isNil()) { ptr.getMemoryIO().putAddress(m.getOffset(ptr), 0L); cache.putReference(m, value); } else { Pointer cb = Factory.getInstance().getCallbackManager().getCallback(context.runtime, (CallbackInfo) m.type, value); ptr.getMemoryIO().putMemoryIO(m.getOffset(ptr), cb.getMemoryIO()); cache.putReference(m, cb); } }
public void put(ThreadContext context, Storage cache, Member m, AbstractMemory ptr, IRubyObject value) { if (value.isNil()) { ptr.getMemoryIO().putAddress(m.getOffset(ptr), 0L); cache.putReference(m, value); } else { Pointer cb = Factory.getInstance().getCallbackManager().getCallback(context.runtime, (CallbackInfo) m.type, value); ptr.getMemoryIO().putMemoryIO(m.getOffset(ptr), cb.getMemoryIO()); cache.putReference(m, cb); } }
public void put(ThreadContext context, StructLayout.Storage cache, Member m, AbstractMemory ptr, IRubyObject value) { ByteList bl = value.convertToString().getByteList(); MemoryPointer mem = MemoryPointer.allocate(context.runtime, 1, bl.length() + 1, false); // // Keep a reference to the temporary memory in the cache so it does // not get freed by the GC until the struct is freed // cache.putReference(m, mem); MemoryIO io = mem.getMemoryIO(); io.put(0, bl.getUnsafeBytes(), bl.begin(), bl.length()); io.putByte(bl.length(), (byte) 0); ptr.getMemoryIO().putMemoryIO(m.getOffset(ptr), io); }
public void put(ThreadContext context, StructLayout.Storage cache, Member m, AbstractMemory ptr, IRubyObject value) { ByteList bl = value.convertToString().getByteList(); MemoryPointer mem = MemoryPointer.allocate(context.runtime, 1, bl.length() + 1, false); // // Keep a reference to the temporary memory in the cache so it does // not get freed by the GC until the struct is freed // cache.putReference(m, mem); MemoryIO io = mem.getMemoryIO(); io.put(0, bl.getUnsafeBytes(), bl.begin(), bl.length()); io.putByte(bl.length(), (byte) 0); ptr.getMemoryIO().putMemoryIO(m.getOffset(ptr), io); }
public void put(ThreadContext context, StructLayout.Storage cache, Member m, AbstractMemory ptr, IRubyObject value) { ByteList bl = value.convertToString().getByteList(); MemoryPointer mem = MemoryPointer.allocate(context.runtime, 1, bl.length() + 1, false); // // Keep a reference to the temporary memory in the cache so it does // not get freed by the GC until the struct is freed // cache.putReference(m, mem); MemoryIO io = mem.getMemoryIO(); io.put(0, bl.getUnsafeBytes(), bl.begin(), bl.length()); io.putByte(bl.length(), (byte) 0); ptr.getMemoryIO().putMemoryIO(m.getOffset(ptr), io); }
public void put(ThreadContext context, StructLayout.Storage cache, Member m, AbstractMemory ptr, IRubyObject value) { ByteList bl = value.convertToString().getByteList(); MemoryPointer mem = MemoryPointer.allocate(context.runtime, 1, bl.length() + 1, false); // // Keep a reference to the temporary memory in the cache so it does // not get freed by the GC until the struct is freed // cache.putReference(m, mem); MemoryIO io = mem.getMemoryIO(); io.put(0, bl.getUnsafeBytes(), bl.begin(), bl.length()); io.putByte(bl.length(), (byte) 0); ptr.getMemoryIO().putMemoryIO(m.getOffset(ptr), io); }