doc: fix Fast FFI argument count in ffi.md#63960
Conversation
|
Review requested:
|
|
Thanks for this. |
The text said functions with more than 7 arguments fall back to the generic call path, contradicting the preceding sentence that Fast FFI calls support up to 8 arguments. The real limit is architecture- and type-dependent: the hard cap is 8 public arguments (src/ffi/fast.cc), but register pressure lowers the effective count to 7 integer/pointer arguments on AArch64 and 6 on x86-64, while floating-point arguments can use up to 8 on both. Describe this instead of the previous, inaccurate single threshold. Signed-off-by: Daijiro Wachi <daijiro.wachi@gmail.com>
|
@ShogunPanda Thanks for the careful review, you're right that it's architecture-dependent. I cross-checked the trampoline generators and ffi-fast-api-internals.md: the hard cap is 8 public arguments (src/ffi/fast.cc), but register pressure lowers the effective count to 7 integer/pointer arguments on AArch64 (src/ffi/platforms/arm64.cc) and 6 on x86-64 (src/ffi/platforms/x64.cc), while floating-point arguments can use up to 8 on both. Rather than the generic "7 or 8", I reworded the paragraph to spell out the per-architecture limits so the API doc matches the internals doc. Let me know if you'd prefer the shorter generic phrasing instead. |
The text said functions with more than 7 arguments fall back to the generic call path, contradicting the preceding sentence that Fast FFI calls support up to 8 arguments. The implementation only falls back when there are more than 8 arguments (src/ffi/fast.cc), so correct the threshold to 8.