GeezerVison is showing github.com — doc: fix Fast FFI argument count in ffi.md · nodejs/node@ef4915f
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: doc/api/ffi.md +7-2Lines changed: 7 additions & 2 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -125,8 +125,13 @@ raw pointer `bigint` values. For pointer-like parameters, `null`, `undefined`, |
125 | 125 | strings, `Buffer`, typed array, `DataView`, and `ArrayBuffer` values are |
126 | 126 | converted on the JavaScript side before calling the optimized native wrapper. |
127 | 127 |
|
128 | | -Optimized Fast FFI calls support at most 8 function arguments. Functions with |
129 | | -more than 7 arguments use the generic FFI call path instead. |
| 128 | +Optimized Fast FFI calls support at most 8 function arguments, but the exact |
| 129 | +limit depends on the architecture and on the argument types, because each |
| 130 | +argument must fit in the registers used by the platform trampoline. Integer |
| 131 | +and pointer arguments are limited to 7 on AArch64 and to 6 on x86-64, while |
| 132 | +floating-point arguments can use up to 8 on both. Functions that exceed these |
| 133 | +limits, including any function with more than 8 arguments, use the generic FFI |
| 134 | +call path instead. |
130 | 135 |
|
131 | 136 | ## Signature objects |
132 | 137 |
|
|