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 descriptor and options pair for foreign downcalls at runtime.

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 descriptor and options pair for foreign downcalls at runtime. Needed in order to get a method handle using downcallHandle

Since the foreign functions feature is currently a preview of the Java platform (as part of Project Panama), this API is itself a preview subject to changes following changes in the feature itself. This also means that this feature must be manually enabled, using '--enable-preview'. 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