# 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
`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.
`FunctionDescriptor`
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`
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`
FunctionDescriptor.`withReturnLayout(MemoryLayout newReturn)`
Create a new function descriptor with the given memory layout as the new return layout.
`FunctionDescriptor`
FunctionDescriptor.`withVoidReturnLayout()`
Create a new function descriptor with the return layout dropped.
Methods in jdk.incubator.foreign that return types with arguments of type FunctionDescriptor
Modifier and Type
Method
Description
`Optional<DynamicConstantDesc<FunctionDescriptor>>`
FunctionDescriptor.`describeConstable()`
Methods in jdk.incubator.foreign with parameters of type FunctionDescriptor
Modifier and Type
Method
Description
`MethodHandle`
CLinker.`downcallHandle(MethodType type, 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 an address.
`MethodHandle`
CLinker.`downcallHandle(Addressable symbol, MethodType type, 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 given address.
`MethodHandle`
CLinker.`downcallHandle(Addressable symbol, SegmentAllocator allocator, MethodType type, FunctionDescriptor function)`
Obtain 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 given address.
`MemoryAddress`
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.