Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrades to zig 0.9 and more #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

trashhalo
Copy link

@trashhalo trashhalo commented Dec 27, 2021

I was using this library as a foundation for https://github.com/trashhalo/create-zig-wasm-app
Here are the changes I made a long the way. Let me know if you want me to try and cut this up to be smaller.

  1. zig 0.9 support. allocator changes mostly
  2. be more forgiving when functions return implied error union types. (Function takes anyerror now)
  3. allow functions to not return anything. Function now is optional. send a 0 len pointer back to client in this case
  4. switch some things to const to allow inlining the function call loop
  5. when a function errors serialize the name back to the client so you can get an idea of what went wrong
  6. using an arraylist instead of doing len math to alloc the exact right number of bytes.
  7. give caller control over allocator creation

pass in allocator
serialize error name back to host
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.

1 participant