Class NativeObject
java.lang.Object
org.graalvm.nativebridge.NativeObject
Encapsulates a handle to an object in a native image heap where the object's lifetime is bound to
the lifetime of the
NativeObject instance. At some point, after a NativeObject is
garbage collected, a call is made to release the handle, allowing the corresponding object in the
native image heap to be collected.-
Constructor Summary
ConstructorsConstructorDescriptionNativeObject(NativeIsolate isolate, long objectHandle) Creates a newNativeObject. -
Method Summary
Modifier and TypeMethodDescriptionfinal longReturns a handle to an object in the native image heap.final NativeIsolateReturns an isolate in which an object referenced by this handle exists.final voidrelease()Explicitly releases object in the native image heap referenced by this handle.
-
Constructor Details
-
NativeObject
Creates a newNativeObject.- Parameters:
isolate- an isolate in which an object referenced by the handle exists.objectHandle- a handle to an object in a native image heap
-
-
Method Details
-
getIsolate
Returns an isolate in which an object referenced by this handle exists. -
getHandle
public final long getHandle()Returns a handle to an object in the native image heap. -
release
public final void release()Explicitly releases object in the native image heap referenced by this handle. The use of this method should be exceptional. By default, the lifetime of the object in the native image heap is bound to the lifetime of theNativeObjectinstance.
-