public final class RuntimeForeignAccess extends Object
Modifier and Type | Method and Description |
---|---|
static void |
registerForDowncall(Object desc,
Object... options)
Registers the provided descriptor and options pair for foreign downcalls at runtime.
|
public static void registerForDowncall(Object desc, Object... options)
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.
desc
- A FunctionDescriptor
to register for downcalls.options
- An array of Linker.Option
used for the downcalls.