Search in sources :

Example 6 with NativeTruffleContext

use of com.oracle.svm.truffle.nfi.NativeAPI.NativeTruffleContext in project graal by oracle.

the class Target_com_oracle_truffle_nfi_impl_NFIContext method disposeNativeContext.

@Substitute
private static void disposeNativeContext(long context) {
    TruffleNFISupport support = ImageSingletons.lookup(TruffleNFISupport.class);
    NativeTruffleContext ctx = WordFactory.pointer(context);
    support.destroyContextHandle(ctx.contextHandle());
    UnmanagedMemory.free(ctx);
}
Also used : NativeTruffleContext(com.oracle.svm.truffle.nfi.NativeAPI.NativeTruffleContext) Substitute(com.oracle.svm.core.annotate.Substitute)

Aggregations

Substitute (com.oracle.svm.core.annotate.Substitute)6 NativeTruffleContext (com.oracle.svm.truffle.nfi.NativeAPI.NativeTruffleContext)6 LibFFI.ffi_cif (com.oracle.svm.truffle.nfi.libffi.LibFFI.ffi_cif)3 NativeTruffleEnv (com.oracle.svm.truffle.nfi.NativeAPI.NativeTruffleEnv)1 PinnedObject (org.graalvm.nativeimage.PinnedObject)1 CLongPointer (org.graalvm.nativeimage.c.type.CLongPointer)1 WordPointer (org.graalvm.nativeimage.c.type.WordPointer)1