On Wed, 21 Jan 2026 21:11:28 GMT, Weijun Wang <[email protected]> wrote:

>> Do you have a suggestion? I intentionally indented based on argument 
>> nesting. `FunctionDescriptor.of(...` is the 2nd argument of `downcallHandle` 
>> so I indented one level (8 spaces) to the method. 
>> `OperatingSystem.isAix()...` is argument of `findOrThrow` and 
>> `calling_convention_requires_int_as_long...` etc are arguments of 
>> `FunctionDescriptor.of` and they are indented one level further. IntelliJ 
>> IDEA unindents the `FunctionDescriptor.of(...)` block but I think that's 
>> misleading.
>
> As for whether it's a better alternative of JNI, FFM is usually considered at 
> least as fast as JNI. In this case, on my Mac, the FFM version is much much 
> faster. I guess the main reason is while the C code is quite small it calls 
> back to Java object manipulation too much.

> IntelliJ IDEA unindents the FunctionDescriptor.of(...) block but I think 
> that's misleading.

That's what I thought.

Ok. Another advantage is that we don't need the .c file any more. If 
performance matters, we could still tune it by using the critical option. But I 
guess it's fast enough.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28931#discussion_r2714401065

Reply via email to