Package jnr.ffi.provider
Class AbstractRuntime
java.lang.Object
jnr.ffi.Runtime
jnr.ffi.provider.AbstractRuntime
- Direct Known Subclasses:
NativeRuntime
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal long
Gets the address mask for this runtimefinal int
Gets the size of an address (e.g.final ByteOrder
Retrieves this runtime's native byte order.final Type
findType
(NativeType type) Looks up the runtime-specific that corresponds to the pseudo-typeabstract int
Gets the last native error code.abstract MemoryManager
Gets the native memory manager instance for this runtimefinal int
longSize()
Gets the size of a C long integer for this runtimeabstract void
setLastError
(int error) Sets the native error code.Methods inherited from class jnr.ffi.Runtime
findType, getClosureManager, getLoadedLibraries, getRuntime, getSystemRuntime, isCompatible, newObjectReferenceManager
-
Field Details
-
types
-
addressMask
private final long addressMask -
addressSize
private final int addressSize -
longSize
private final int longSize -
byteOrder
-
-
Constructor Details
-
AbstractRuntime
-
-
Method Details
-
findType
Looks up the runtime-specific that corresponds to the pseudo-type -
getMemoryManager
Gets the native memory manager instance for this runtime- Specified by:
getMemoryManager
in classRuntime
- Returns:
- a
MemoryManager
-
getLastError
public abstract int getLastError()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 classRuntime
- Returns:
- The errno value.
-
setLastError
public abstract void setLastError(int error) Sets the native error code.- Specified by:
setLastError
in classRuntime
- Parameters:
error
- The value to set errno to.
-
addressMask
public final long addressMask()Gets the address mask for this runtime- Specified by:
addressMask
in classRuntime
- Returns:
- The address mask for the runtime.
-
addressSize
public final int addressSize()Gets the size of an address (e.g. a pointer) for this runtime- Specified by:
addressSize
in classRuntime
- Returns:
- The size of an address in bytes.
-
longSize
public final int longSize()Gets the size of a C long integer for this runtime -
byteOrder
Retrieves this runtime's native byte order.
-