# Uses of Class
jdk.incubator.foreign.FunctionDescriptor

Packages that use FunctionDescriptor
Package
Description
jdk.incubator.foreign
Classes to support low-level and efficient foreign memory/function access, directly from Java.

## Uses of FunctionDescriptor in jdk.incubator.foreign

Methods in jdk.incubator.foreign that return FunctionDescriptor
Modifier and Type
Method
Description
`FunctionDescriptor`
FunctionDescriptor.`appendArgumentLayouts(MemoryLayout... addedLayouts)`
Create a new function descriptor with the given argument layouts appended to the argument layout array of this function descriptor.
`FunctionDescriptor`
FunctionDescriptor.`asVariadic(MemoryLayout... variadicLayouts)`
Obtain a specialized variadic function descriptor, by appending given variadic layouts to this function descriptor argument layouts.
`FunctionDescriptor`
FunctionDescriptor.`changeReturnLayout(MemoryLayout newReturn)`
Create a new function descriptor with the given memory layout as the new return layout.
`FunctionDescriptor`
FunctionDescriptor.`dropReturnLayout()`
Create a new function descriptor with the return layout dropped.
`FunctionDescriptor`
FunctionDescriptor.`insertArgumentLayouts(int index, MemoryLayout... addedLayouts)`
Create a new function descriptor with the given argument layouts inserted at the given index, into the argument layout array of this function descriptor.
`static 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.
Methods in jdk.incubator.foreign that return types with arguments of type FunctionDescriptor
Modifier and Type
Method
Description
`Optional<DynamicConstantDesc<FunctionDescriptor>>`
FunctionDescriptor.`describeConstable()`
Returns an `Optional` containing the nominal descriptor for this function descriptor, if one can be constructed, or an empty `Optional` if one cannot be constructed.
Methods in jdk.incubator.foreign with parameters of type FunctionDescriptor
Modifier and Type
Method
Description
`MethodHandle`
CLinker.`downcallHandle(FunctionDescriptor function)`
Obtains a foreign method handle, with the given type and featuring the given function descriptor, which can be used to call a target foreign function at the address in a dynamically provided native symbol.
`default MethodHandle`
CLinker.`downcallHandle(NativeSymbol symbol, FunctionDescriptor function)`
Obtains a foreign method handle, with the given type and featuring the given function descriptor, which can be used to call a target foreign function at the address in the given native symbol.
`static MethodType`
CLinker.`downcallType(FunctionDescriptor functionDescriptor)`
Obtains the downcall method handle type associated with a given function descriptor.
`NativeSymbol`
CLinker.`upcallStub(MethodHandle target, FunctionDescriptor function, ResourceScope scope)`
Allocates a native stub with given scope which 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.
`static MethodType`
CLinker.`upcallType(FunctionDescriptor functionDescriptor)`
Obtains the method handle type associated with an upcall stub with given function descriptor.