public final IRubyObject get(Ruby runtime, MemoryIO io, long offset) { return new Pointer(runtime, io.getMemoryIO(offset)); } }
public final IRubyObject get(Ruby runtime, MemoryIO io, long offset) { return new Pointer(runtime, io.getMemoryIO(offset)); } }
public final IRubyObject get(Ruby runtime, MemoryIO io, long offset) { return new Pointer(runtime, io.getMemoryIO(offset)); } }
protected Pointer getPointer(Ruby runtime, long offset) { return new Pointer(runtime, getMemoryIO().getMemoryIO(offset)); } public int getInOutFlags() {
protected Pointer getPointer(Ruby runtime, long offset) { return new Pointer(runtime, getMemoryIO().getMemoryIO(offset)); } public int getInOutFlags() {
protected Pointer getPointer(Ruby runtime, long offset) { return new Pointer(runtime, getMemoryIO().getMemoryIO(offset)); } public int getInOutFlags() {
protected Pointer getPointer(Ruby runtime, long offset) { return new Pointer(runtime, getMemoryIO().getMemoryIO(offset)); } public int getInOutFlags() {
protected Pointer getPointer(Ruby runtime, long offset) { return new Pointer(runtime, getPointerClass(runtime), getMemoryIO().getMemoryIO(offset), Long.MAX_VALUE); }
public IRubyObject get(ThreadContext context, StructLayout.Storage cache, Member m, AbstractMemory ptr) { MemoryIO memory = ((AbstractMemory) ptr).getMemoryIO().getMemoryIO(m.getOffset(ptr)); IRubyObject old = cache.getCachedValue(m); if (old instanceof Pointer) { MemoryIO oldMemory = ((Pointer) old).getMemoryIO(); if (memory.equals(oldMemory)) { return old; } } Pointer retval = new Pointer(context.runtime, memory); cache.putCachedValue(m, retval); return retval; }
public IRubyObject get(ThreadContext context, StructLayout.Storage cache, Member m, AbstractMemory ptr) { MemoryIO memory = ((AbstractMemory) ptr).getMemoryIO().getMemoryIO(m.getOffset(ptr)); IRubyObject old = cache.getCachedValue(m); if (old instanceof Pointer) { MemoryIO oldMemory = ((Pointer) old).getMemoryIO(); if (memory.equals(oldMemory)) { return old; } } Pointer retval = new Pointer(context.runtime, memory); cache.putCachedValue(m, retval); return retval; }
public IRubyObject get(ThreadContext context, StructLayout.Storage cache, Member m, AbstractMemory ptr) { MemoryIO io = ptr.getMemoryIO().getMemoryIO(m.getOffset(ptr)); if (io == null || io.isNull()) { return context.nil; } return RubyString.newStringNoCopy(context.runtime, io.getZeroTerminatedByteArray(0)); }
public IRubyObject get(ThreadContext context, StructLayout.Storage cache, Member m, AbstractMemory ptr) { MemoryIO io = ptr.getMemoryIO().getMemoryIO(m.getOffset(ptr)); if (io == null || io.isNull()) { return context.nil; } return RubyString.newStringNoCopy(context.runtime, io.getZeroTerminatedByteArray(0)); }
public IRubyObject get(ThreadContext context, StructLayout.Storage cache, Member m, AbstractMemory ptr) { MemoryIO memory = ((AbstractMemory) ptr).getMemoryIO().getMemoryIO(m.getOffset(ptr)); IRubyObject old = cache.getCachedValue(m); if (old instanceof Pointer) { MemoryIO oldMemory = ((Pointer) old).getMemoryIO(); if (memory.equals(oldMemory)) { return old; } } Pointer retval = new Pointer(context.runtime, memory); cache.putCachedValue(m, retval); return retval; }
public IRubyObject get(ThreadContext context, StructLayout.Storage cache, Member m, AbstractMemory ptr) { MemoryIO io = ptr.getMemoryIO().getMemoryIO(m.getOffset(ptr)); if (io == null || io.isNull()) { return context.runtime.getNil(); } return RubyString.newStringNoCopy(context.runtime, io.getZeroTerminatedByteArray(0)); }
public IRubyObject get(ThreadContext context, StructLayout.Storage cache, Member m, AbstractMemory ptr) { MemoryIO io = ptr.getMemoryIO().getMemoryIO(m.getOffset(ptr)); if (io == null || io.isNull()) { return context.runtime.getNil(); } return RubyString.newStringNoCopy(context.runtime, io.getZeroTerminatedByteArray(0)); }
@JRubyMethod(name = { "get_array_of_string" }, required = 1) public IRubyObject get_array_of_string(ThreadContext context, IRubyObject rbOffset) { final int POINTER_SIZE = (Platform.getPlatform().addressSize() / 8); final Ruby runtime = context.runtime; final RubyArray arr = RubyArray.newArray(runtime); for (long off = getOffset(rbOffset); off <= size - POINTER_SIZE; off += POINTER_SIZE) { final MemoryIO mem = getMemoryIO().getMemoryIO(off); if (mem == null || mem.isNull()) { break; } arr.add(MemoryUtil.getTaintedString(runtime, mem, 0)); } return arr; }
@JRubyMethod(name = { "get_array_of_string" }, required = 1) public IRubyObject get_array_of_string(ThreadContext context, IRubyObject rbOffset) { final int POINTER_SIZE = (Platform.getPlatform().addressSize() / 8); final Ruby runtime = context.runtime; final RubyArray arr = RubyArray.newArray(runtime); for (long off = getOffset(rbOffset); off <= size - POINTER_SIZE; off += POINTER_SIZE) { final MemoryIO mem = getMemoryIO().getMemoryIO(off); if (mem == null || mem.isNull()) { break; } arr.add(MemoryUtil.getTaintedString(runtime, mem, 0)); } return arr; }
@JRubyMethod(name = { "get_array_of_string" }, required = 1) public IRubyObject get_array_of_string(ThreadContext context, IRubyObject rbOffset) { final int POINTER_SIZE = (Platform.getPlatform().addressSize() / 8); final Ruby runtime = context.runtime; final RubyArray arr = RubyArray.newArray(runtime); for (long off = getOffset(rbOffset); off <= size - POINTER_SIZE; off += POINTER_SIZE) { final MemoryIO mem = getMemoryIO().getMemoryIO(off); if (mem == null || mem.isNull()) { break; } arr.add(MemoryUtil.getTaintedString(runtime, mem, 0)); } return arr; }
@JRubyMethod(name = { "get_array_of_string" }, required = 2) public IRubyObject get_array_of_string(ThreadContext context, IRubyObject rbOffset, IRubyObject rbCount) { final int POINTER_SIZE = (Platform.getPlatform().addressSize() / 8); final long off = getOffset(rbOffset); final int count = Util.int32Value(rbCount); final Ruby runtime = context.runtime; final RubyArray arr = RubyArray.newArray(runtime, count); for (int i = 0; i < count; ++i) { final MemoryIO mem = getMemoryIO().getMemoryIO(off + (i * POINTER_SIZE)); arr.add(mem != null && !mem.isNull() ? MemoryUtil.getTaintedString(runtime, mem, 0) : runtime.getNil()); } return arr; }
@JRubyMethod(name = { "get_array_of_string" }, required = 2) public IRubyObject get_array_of_string(ThreadContext context, IRubyObject rbOffset, IRubyObject rbCount) { final int POINTER_SIZE = (Platform.getPlatform().addressSize() / 8); final long off = getOffset(rbOffset); final int count = Util.int32Value(rbCount); final Ruby runtime = context.runtime; final RubyArray arr = RubyArray.newArray(runtime, count); for (int i = 0; i < count; ++i) { final MemoryIO mem = getMemoryIO().getMemoryIO(off + (i * POINTER_SIZE)); arr.add(mem != null && !mem.isNull() ? MemoryUtil.getTaintedString(runtime, mem, 0) : runtime.getNil()); } return arr; }