Uses of Class
jdk.incubator.foreign.FunctionDescriptor
Package
Description
Classes to support low-level and efficient foreign memory/function access, directly from Java.
-
Uses of FunctionDescriptor in jdk.incubator.foreign
Modifier and TypeMethodDescriptionstatic FunctionDescriptor
FunctionDescriptor.of(MemoryLayout resLayout, MemoryLayout... argLayouts)
Create a function descriptor with given return and argument layouts.static FunctionDescriptor
FunctionDescriptor.ofVoid(MemoryLayout... argLayouts)
Create a function descriptor with given argument layouts and no return layout.FunctionDescriptor.withAppendedArgumentLayouts(MemoryLayout... addedLayouts)
Create a new function descriptor with the given argument layouts appended to the argument layout array of this function descriptor.FunctionDescriptor.withAttribute(String name, Constable value)
Returns a new function descriptor which features the same attributes as this descriptor, plus the newly specified attribute.FunctionDescriptor.withReturnLayout(MemoryLayout newReturn)
Create a new function descriptor with the given memory layout as the new return layout.FunctionDescriptor.withVoidReturnLayout()
Create a new function descriptor with the return layout dropped.Modifier and TypeMethodDescriptionCLinker.downcallHandle(Addressable symbol, MethodType type, FunctionDescriptor function)
Obtain a foreign method handle, with given type, which can be used to call a target foreign function at a given address and featuring a given function descriptor.CLinker.upcallStub(MethodHandle target, FunctionDescriptor function)
Allocates a native segment whose base address (seeMemorySegment.address()
) can be passed to other foreign functions (as a function pointer); calling such a function pointer from native code will result in the execution of the provided method handle.