io.vproxy.pni.graal.GraalPNIRef Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pni-api-graal-jdk22 Show documentation
Show all versions of pni-api-graal-jdk22 Show documentation
panama native interface pni-api-graal-jdk22
The newest version!
package io.vproxy.pni.graal;
import io.vproxy.pni.PNIRef;
import org.graalvm.nativeimage.IsolateThread;
import org.graalvm.nativeimage.c.function.CEntryPoint;
import org.graalvm.nativeimage.c.function.CEntryPointLiteral;
import org.graalvm.nativeimage.c.function.CFunctionPointer;
import java.lang.foreign.MemorySegment;
public class GraalPNIRef {
private static final CEntryPointLiteral releaseFunc
= CEntryPointLiteral.create(GraalPNIRef.class, "release", IsolateThread.class, long.class);
public static MemorySegment getReleaseFunctionPointer() {
return MemorySegment.ofAddress(releaseFunc.getFunctionPointer().rawValue());
}
@SuppressWarnings("unused")
@CEntryPoint
public static void release(IsolateThread thread, long index) {
PNIRef.release(index);
}
}