Skip to content

fix: match exposeHostFunction signature for wasi#241

Merged
malcolmstill merged 1 commit intomalcolmstill:masterfrom
slunghq:master
Feb 28, 2026
Merged

fix: match exposeHostFunction signature for wasi#241
malcolmstill merged 1 commit intomalcolmstill:masterfrom
slunghq:master

Conversation

@notxorand
Copy link
Contributor

wasi.zig currently use function signature that doesn't match the exposeHostFunction pattern. that doesn't work

@notxorand
Copy link
Contributor Author

btw, i figured the host context is probably for passing runtime state to the host functions (from my perspective a pointer usize) for their use. i think that should be documented somewhere

@malcolmstill
Copy link
Owner

@notxorand sorry for the delay and thank you for the fix.

The fact that the bug exists speaks to the lack of testing of the wasi stuff.

btw, i figured the host context is probably for passing runtime state to the host functions (from my perspective a pointer usize) for their use. i think that should be documented somewhere

I agree. Would also be open to giving this a different name (e.g. user_data like in drmModePageFlip) or perhaps even defining a union like epoll_data.

@malcolmstill malcolmstill merged commit 7ad2536 into malcolmstill:master Feb 28, 2026
13 checks passed
@notxorand
Copy link
Contributor Author

I agree. Would also be open to giving this a different name (e.g. user_data like in drmModePageFlip) or perhaps even defining a union like epoll_data.

imo, the name is quite clear as is if communicated via a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants