Class NativeRuntime


public final class NativeRuntime extends AbstractRuntime
  • Method Details

    • getInstance

      public static NativeRuntime getInstance()
    • getLoadedLibraries

      public static List<NativeLibrary.LoadedLibraryData> getLoadedLibraries()
      See and use Runtime.getLoadedLibraries() (which forwards here) instead of this directly
    • findType

      public Type findType(TypeAlias type)
      Description copied from class: Runtime
      Looks up the runtime-specific type that corresponds to the type alias
      Specified by:
      findType in class Runtime
      Parameters:
      type - the type alias.
      Returns:
      A Type instance
    • getMemoryManager

      public final NativeMemoryManager getMemoryManager()
      Description copied from class: AbstractRuntime
      Gets the native memory manager instance for this runtime
      Specified by:
      getMemoryManager in class AbstractRuntime
      Returns:
      a MemoryManager
    • getClosureManager

      public jnr.ffi.provider.jffi.NativeClosureManager getClosureManager()
      Description copied from class: Runtime
      Gets the native closure manager for this runtime
      Specified by:
      getClosureManager in class Runtime
      Returns:
      The ClosureManager of the runtime
    • newObjectReferenceManager

      public ObjectReferenceManager newObjectReferenceManager()
      Description copied from class: Runtime
      Creates a new ObjectReferenceManager
      Specified by:
      newObjectReferenceManager in class Runtime
      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 class AbstractRuntime
      Returns:
      The errno value.
    • setLastError

      public void setLastError(int error)
      Description copied from class: AbstractRuntime
      Sets the native error code.
      Specified by:
      setLastError in class AbstractRuntime
      Parameters:
      error - The value to set errno to.
    • isCompatible

      public boolean isCompatible(Runtime other)
      Description copied from class: Runtime
      Indicates whether this Runtime instance is compatible with another Runtime 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 class Runtime
      Parameters:
      other - the other runtime to test for compatibility
      Returns:
      true if the other runtime is compatible with this one
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object