< prev index next > src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/aarch64/macos/MacOsAArch64Linker.java
Print this page
@Override
public final MethodHandle downcallHandle(FunctionDescriptor function) {
Objects.requireNonNull(function);
MethodType type = SharedUtils.inferMethodType(function, false);
MethodHandle handle = CallArranger.MACOS.arrangeDowncall(type, function);
- if (!type.returnType().equals(MemorySegment.class)) {
- // not returning segment, just insert a throwing allocator
- handle = MethodHandles.insertArguments(handle, 1, SharedUtils.THROWING_ALLOCATOR);
- }
+ handle = SharedUtils.maybeInsertAllocator(handle);
return SharedUtils.wrapDowncall(handle, function);
}
@Override
public final NativeSymbol upcallStub(MethodHandle target, FunctionDescriptor function, ResourceScope scope) {
< prev index next >