Skip to content

feat: support indirect parameters for exported functions - #222

Open
Xe wants to merge 1 commit into
arcjet:mainfrom
TecharoHQ:Xe/many-params
Open

feat: support indirect parameters for exported functions#222
Xe wants to merge 1 commit into
arcjet:mainfrom
TecharoHQ:Xe/many-params

Conversation

@Xe

@Xe Xe commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

The ABI passes a function's parameters on the stack when your function (or a record passed to that function) has 16 or less parameters (including record fields). Past that limit the caller has to malloc into the guest for copying parameters over.

Implement wit-bindgen's Instruction::Malloc for guest exports by calling cabi_realloc in the guest and using those pointers to write data.

Test coverage was added to the instructions example to ensure this doesn't incur regressions.

Assisted-by: Claude Opus 5 via Claude Code

The ABI passes a function's parameters on the stack when your
function (or a record passed to that function) has 16 or less
parameters (including record fields). Past that limit the caller
has to malloc into the guest for copying parameters over.

Implement wit-bindgen's Instruction::Malloc for guest exports by
calling cabi_realloc in the guest and using those pointers to
write data.

Test coverage was added to the instructions example to ensure this
doesn't incur regressions.

Assisted-by: Claude Opus 5 via Claude Code
Signed-off-by: Xe Iaso <me@xeiaso.net>
@Xe
Xe requested a review from a team as a code owner September 5, 2026 18:01
@arcjet-review arcjet-review Bot added the needs review Awaiting human review label Sep 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs review Awaiting human review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant