Package jnr.ffi.provider.jffi
Class NativeRuntime
java.lang.Object
jnr.ffi.Runtime
jnr.ffi.provider.AbstractRuntime
jnr.ffi.provider.jffi.NativeRuntime
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final class
private static final class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Type[]
private final NativeClosureManager
(package private) final WeakHashMap
<NativeLibrary, NativeLibrary.LoadedLibraryData> private final NativeMemoryManager
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static NativeType[]
private static EnumMap
<NativeType, Type> boolean
Looks up the runtime-specific type that corresponds to the type aliasGets the native closure manager for this runtimestatic NativeRuntime
int
Gets the last native error code.static List
<NativeLibrary.LoadedLibraryData> See and useRuntime.getLoadedLibraries()
(which forwards here) instead of this directlyfinal NativeMemoryManager
Gets the native memory manager instance for this runtimeint
hashCode()
boolean
isCompatible
(Runtime other) Indicates whether thisRuntime
instance is compatible with anotherRuntime
instance.private static Type
jafflType
(NativeType type) Creates a newObjectReferenceManager
void
setLastError
(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
-
Field Details
-
mm
-
closureManager
-
aliases
-
loadedLibraries
-
-
Constructor Details
-
NativeRuntime
private NativeRuntime()
-
-
Method Details
-
getInstance
-
getLoadedLibraries
See and useRuntime.getLoadedLibraries()
(which forwards here) instead of this directly -
buildTypeMap
-
buildNativeTypeAliases
-
findType
Description copied from class:Runtime
Looks up the runtime-specific type that corresponds to the type alias -
getMemoryManager
Description copied from class:AbstractRuntime
Gets the native memory manager instance for this runtime- Specified by:
getMemoryManager
in classAbstractRuntime
- Returns:
- a
MemoryManager
-
getClosureManager
Description copied from class:Runtime
Gets the native closure manager for this runtime- Specified by:
getClosureManager
in classRuntime
- Returns:
- The
ClosureManager
of the runtime
-
newObjectReferenceManager
Description copied from class:Runtime
Creates a newObjectReferenceManager
- Specified by:
newObjectReferenceManager
in classRuntime
- Returns:
- A new
ObjectReferenceManager
-
getLastError
public int getLastError()Description copied from class:AbstractRuntime
Gets the last native error code.This returns the errno value that was set at the time of the last native function call.
- Specified by:
getLastError
in classAbstractRuntime
- Returns:
- The errno value.
-
setLastError
public void setLastError(int error) Description copied from class:AbstractRuntime
Sets the native error code.- Specified by:
setLastError
in classAbstractRuntime
- Parameters:
error
- The value to set errno to.
-
isCompatible
Description copied from class:Runtime
Indicates whether thisRuntime
instance is compatible with anotherRuntime
instance.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:
isCompatible
in classRuntime
- Parameters:
other
- the other runtime to test for compatibility- Returns:
- true if the other runtime is compatible with this one
-
equals
-
hashCode
public int hashCode() -
jafflType
-