- java.lang.Object
-
- jnr.ffi.Runtime
-
- jnr.ffi.provider.AbstractRuntime
-
- jnr.ffi.provider.jffi.NativeRuntime
-
public final class NativeRuntime extends AbstractRuntime
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)TypefindType(TypeAlias type)Looks up the runtime-specific type that corresponds to the type aliasjnr.ffi.provider.jffi.NativeClosureManagergetClosureManager()Gets the native closure manager for this runtimestatic NativeRuntimegetInstance()intgetLastError()Gets the last native error code.static List<NativeLibrary.LoadedLibraryData>getLoadedLibraries()See and useRuntime.getLoadedLibraries()(which forwards here) instead of this directlyNativeMemoryManagergetMemoryManager()Gets the native memory manager instance for this runtimeinthashCode()booleanisCompatible(Runtime other)Indicates whether thisRuntimeinstance is compatible with anotherRuntimeinstance.ObjectReferenceManagernewObjectReferenceManager()Creates a newObjectReferenceManagervoidsetLastError(int error)Sets the native error code.-
Methods inherited from class jnr.ffi.provider.AbstractRuntime
addressMask, addressSize, byteOrder, findType, longSize
-
Methods inherited from class jnr.ffi.Runtime
getRuntime, getSystemRuntime
-
-
-
-
Method Detail
-
getInstance
public static NativeRuntime getInstance()
-
getLoadedLibraries
public static List<NativeLibrary.LoadedLibraryData> getLoadedLibraries()
See and useRuntime.getLoadedLibraries()(which forwards here) instead of this directly
-
findType
public Type findType(TypeAlias type)
Description copied from class:RuntimeLooks up the runtime-specific type that corresponds to the type alias
-
getMemoryManager
public final NativeMemoryManager getMemoryManager()
Description copied from class:AbstractRuntimeGets the native memory manager instance for this runtime- Specified by:
getMemoryManagerin classAbstractRuntime- Returns:
- a
MemoryManager
-
getClosureManager
public jnr.ffi.provider.jffi.NativeClosureManager getClosureManager()
Description copied from class:RuntimeGets the native closure manager for this runtime- Specified by:
getClosureManagerin classRuntime- Returns:
- The
ClosureManagerof the runtime
-
newObjectReferenceManager
public ObjectReferenceManager newObjectReferenceManager()
Description copied from class:RuntimeCreates a newObjectReferenceManager- Specified by:
newObjectReferenceManagerin classRuntime- Returns:
- A new
ObjectReferenceManager
-
getLastError
public int getLastError()
Description copied from class:AbstractRuntimeGets the last native error code.This returns the errno value that was set at the time of the last native function call.
- Specified by:
getLastErrorin classAbstractRuntime- Returns:
- The errno value.
-
setLastError
public void setLastError(int error)
Description copied from class:AbstractRuntimeSets the native error code.- Specified by:
setLastErrorin classAbstractRuntime- Parameters:
error- The value to set errno to.
-
isCompatible
public boolean isCompatible(Runtime other)
Description copied from class:RuntimeIndicates whether thisRuntimeinstance is compatible with anotherRuntimeinstance.This is not the same as calling
Object.equals(java.lang.Object)- this method only indicates whether or not artifacts from the runtime (e.g. memory addresses) are compatible with artifacts from this one.This is mostly for internal use.
- Specified by:
isCompatiblein classRuntime- Parameters:
other- the other runtime to test for compatibility- Returns:
- true if the other runtime is compatible with this one
-
-