Top Constructors Methods
org.graalvm.nativeimage.hosted

public final Class RuntimeForeignAccess

extends Object
Class Inheritance
Annotations
@Platforms:HOSTED_ONLY
Imports
org.graalvm.nativeimage.ImageSingletons, .Platform, .Platforms, org.graalvm.nativeimage.impl.ConfigurationCondition, .RuntimeForeignAccessSupport

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static void
registerForDowncall(Object
A java.lang.foreign.FunctionDescriptor to register for downcalls.
desc
,
Object...
An array of java.lang.foreign.Linker.Option used for the downcalls.
options
)

Registers the provided function descriptor and options pair at image build time for downcalls into foreign code.

public static void
registerForUpcall(Object
A java.lang.foreign.FunctionDescriptor to register for upcalls.
desc
,
Object...
An array of java.lang.foreign.Linker.Option used for the upcalls.
options
)

Registers the provided function descriptor and options pair at image build time for upcalls from foreign code.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

RuntimeForeignAccessback to summary
private RuntimeForeignAccess()

Method Detail

registerForDowncallback to summary
public static void registerForDowncall(Object desc, Object... options)

Registers the provided function descriptor and options pair at image build time for downcalls into foreign code. Required to get a downcall method handle using java.lang.foreign.Linker#downcallHandle for the same descriptor and options at runtime.

Even though this method is weakly typed for compatibility reasons, runtime checks will be performed to ensure that the arguments have the expected type. It will be deprecated in favor of strongly typed variant as soon as possible.

Parameters
desc:Object

A java.lang.foreign.FunctionDescriptor to register for downcalls.

options:Object[]

An array of java.lang.foreign.Linker.Option used for the downcalls.

Since
23.1
registerForUpcallback to summary
public static void registerForUpcall(Object desc, Object... options)

Registers the provided function descriptor and options pair at image build time for upcalls from foreign code. Required to get an upcall stub function pointer using java.lang.foreign.Linker#upcallStub for the same descriptor and options at runtime.

Even though this method is weakly typed for compatibility reasons, runtime checks will be performed to ensure that the arguments have the expected type. It will be deprecated in favor of strongly typed variant as soon as possible.

Parameters
desc:Object

A java.lang.foreign.FunctionDescriptor to register for upcalls.

options:Object[]

An array of java.lang.foreign.Linker.Option used for the upcalls.

Since
24.1