接口的使用
java.lang.foreign.FunctionDescriptor
-
FunctionDescriptor 的用法PREVIEW 在java.lang.foreign
修饰符和类型方法描述FunctionDescriptor.appendArgumentLayouts(MemoryLayoutPREVIEW... addedLayouts) 返回一个函数描述符,其中给定的参数布局附加到此函数描述符的参数布局数组。FunctionDescriptor.changeReturnLayout(MemoryLayoutPREVIEW newReturn) 返回具有给定内存布局的函数描述符作为新的返回布局。FunctionDescriptor.dropReturnLayout()返回一个函数描述符,返回布局被删除。FunctionDescriptor.insertArgumentLayouts(int index, MemoryLayoutPREVIEW... addedLayouts) 将给定参数布局插入到给定索引处的函数描述符返回到此函数描述符的参数布局数组中。static FunctionDescriptorPREVIEWFunctionDescriptor.of(MemoryLayoutPREVIEW resLayout, MemoryLayoutPREVIEW... argLayouts) 使用给定的返回和参数布局创建函数描述符。static FunctionDescriptorPREVIEWFunctionDescriptor.ofVoid(MemoryLayoutPREVIEW... argLayouts) 创建具有给定参数布局且无返回布局的函数描述符。java.lang.foreign 中的方法,参数类型为 FunctionDescriptorPREVIEW修饰符和类型方法描述Linker.downcallHandle(FunctionDescriptorPREVIEW function, Linker.OptionPREVIEW... options) 创建一个方法句柄,可用于调用具有给定签名的外部函数。default MethodHandleLinker.downcallHandle(MemorySegmentPREVIEW symbol, FunctionDescriptorPREVIEW function, Linker.OptionPREVIEW... options) 创建一个方法句柄,可用于调用具有给定签名和地址的外部函数。Linker.upcallStub(MethodHandle target, FunctionDescriptorPREVIEW function, SegmentScopePREVIEW scope) 创建一个存根,它可以作为函数指针传递给其他外部函数,与给定范围相关联。