public static PointerParameterStrategy getMemoryIOStrategy(MemoryIO memory) { return memory.isDirect() ? DIRECT_MEMORY_IO : HEAP_MEMORY_IO; }
public static PointerParameterStrategy getMemoryIOStrategy(MemoryIO memory) { return memory.isDirect() ? DIRECT_MEMORY_IO : HEAP_MEMORY_IO; }
BoundedNativeMemoryIO(Ruby runtime, MemoryIO parent, long offset, long size) { super(true, parent.address() + offset); this.runtime = runtime; this.size = size; this.parent = parent; if (!parent.isDirect()) throw new IllegalArgumentException("non-direct memory"); }
public static PointerParameterStrategy lookupPointerParameterStrategy(IRubyObject parameter) { if (parameter instanceof MemoryObject) { return ((MemoryObject) parameter).getMemoryIO().isDirect() ? DIRECT_MEMORY_OBJECT : HEAP_MEMORY_OBJECT; } else if (parameter instanceof RubyNil) { return NIL_POINTER_STRATEGY; } else if (parameter instanceof RubyString) { return HEAP_STRING_POINTER_STRATEGY; } return null; }
SwappedMemoryIO(Ruby runtime, MemoryIO io) { super(io.isDirect(), io.address()); this.runtime = runtime; this.io = io; }
public static PointerParameterStrategy lookupPointerParameterStrategy(IRubyObject parameter) { if (parameter instanceof MemoryObject) { return ((MemoryObject) parameter).getMemoryIO().isDirect() ? DIRECT_MEMORY_OBJECT : HEAP_MEMORY_OBJECT; } else if (parameter instanceof RubyNil) { return NIL_POINTER_STRATEGY; } else if (parameter instanceof RubyString) { return HEAP_STRING_POINTER_STRATEGY; } return null; }
BoundedNativeMemoryIO(Ruby runtime, MemoryIO parent, long offset, long size) { super(true, parent.address() + offset); this.runtime = runtime; this.size = size; this.parent = parent; if (!parent.isDirect()) throw new IllegalArgumentException("non-direct memory"); }
SwappedMemoryIO(Ruby runtime, MemoryIO io) { super(io.isDirect(), io.address()); this.runtime = runtime; this.io = io; }
public static PointerParameterStrategy lookupPointerParameterStrategy(IRubyObject parameter) { if (parameter instanceof MemoryObject) { return ((MemoryObject) parameter).getMemoryIO().isDirect() ? DIRECT_MEMORY_OBJECT : HEAP_MEMORY_OBJECT; } else if (parameter instanceof RubyNil) { return NIL_POINTER_STRATEGY; } else if (parameter instanceof RubyString) { return HEAP_STRING_POINTER_STRATEGY; } return null; }
public static PointerParameterStrategy lookupPointerParameterStrategy(IRubyObject parameter) { if (parameter instanceof MemoryObject) { return ((MemoryObject) parameter).getMemoryIO().isDirect() ? DIRECT_MEMORY_OBJECT : HEAP_MEMORY_OBJECT; } else if (parameter instanceof RubyNil) { return NIL_POINTER_STRATEGY; } else if (parameter instanceof RubyString) { return HEAP_STRING_POINTER_STRATEGY; } return null; }
BoundedNativeMemoryIO(Ruby runtime, MemoryIO parent, long offset, long size) { super(true, parent.address() + offset); this.runtime = runtime; this.size = size; this.parent = parent; if (!parent.isDirect()) throw new IllegalArgumentException("non-direct memory"); }
BoundedNativeMemoryIO(Ruby runtime, MemoryIO parent, long offset, long size) { super(true, parent.address() + offset); this.runtime = runtime; this.size = size; this.parent = parent; if (!parent.isDirect()) throw new IllegalArgumentException("non-direct memory"); }
SwappedMemoryIO(Ruby runtime, MemoryIO io) { super(io.isDirect(), io.address()); this.runtime = runtime; this.io = io; }
SwappedMemoryIO(Ruby runtime, MemoryIO io) { super(io.isDirect(), io.address()); this.runtime = runtime; this.io = io; }
public static boolean isDirectPointer(IRubyObject parameter) { return parameter instanceof MemoryObject && ((MemoryObject) parameter).getMemoryIO().isDirect(); }
public static boolean isDirectPointer(IRubyObject parameter) { return parameter instanceof MemoryObject && ((MemoryObject) parameter).getMemoryIO().isDirect(); }
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"); } }