Package org.jruby.ext.ffi.jffi
Class CallbackMemoryIO
java.lang.Object
org.jruby.ext.ffi.MemoryIO
org.jruby.ext.ffi.InvalidMemoryIO
org.jruby.ext.ffi.jffi.CallbackMemoryIO
- All Implemented Interfaces:
AllocatedDirectMemoryIO
An implementation of MemoryIO that throws exceptions on any attempt to read/write
the callback memory area (which is code).
This also keeps the callback alive via the handle member, as long as this
CallbackMemoryIO instance is contained in a valid Callback pointer.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final com.kenai.jffi.Closure.Handleprivate Objectprivate booleanprivate booleanFields inherited from class org.jruby.ext.ffi.InvalidMemoryIO
runtime -
Constructor Summary
ConstructorsConstructorDescriptionCallbackMemoryIO(Ruby runtime, com.kenai.jffi.Closure.Handle handle) CallbackMemoryIO(Ruby runtime, com.kenai.jffi.Closure.Handle handle, Object proc) -
Method Summary
Methods inherited from class org.jruby.ext.ffi.InvalidMemoryIO
array, arrayLength, arrayOffset, asByteBuffer, clear, dup, ex, get, get, get, get, get, get, getAddress, getByte, getDouble, getErrorClass, getFloat, getInt, getLong, getMemoryIO, getNativeLong, getShort, getZeroTerminatedByteArray, getZeroTerminatedByteArray, indexOf, indexOf, order, put, put, put, put, put, put, putAddress, putByte, putDouble, putFloat, putInt, putLong, putMemoryIO, putNativeLong, putShort, putZeroTerminatedByteArray, setMemory, slice, slice
-
Field Details
-
handle
private final com.kenai.jffi.Closure.Handle handle -
released
private volatile boolean released -
unmanaged
private volatile boolean unmanaged -
proc
-
-
Constructor Details
-
CallbackMemoryIO
-
CallbackMemoryIO
-
-
Method Details
-
free
public void free()- Specified by:
freein interfaceAllocatedDirectMemoryIO
-
setAutoRelease
public void setAutoRelease(boolean autorelease) - Specified by:
setAutoReleasein interfaceAllocatedDirectMemoryIO
-
isAutoRelease
public boolean isAutoRelease()- Specified by:
isAutoReleasein interfaceAllocatedDirectMemoryIO
-