-
Notifications
You must be signed in to change notification settings - Fork 47
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
fix: update unwind_tables for latest Zig #127
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Renames all errors to be prefixed with Lua as a sort of namespacing. error.Memory is renamed to error.OutOfMemory to match the Zig errors Closes #16
In preparation for #106, remove these functions that are not needed. These functions conflict with the original intention of using a Zig Allocator to handle all the memory allocation. It should not be necessary to swap out an allocator function or inspect the allocator function during runtime, and that would more than likely lead to bugs. Closes #51
The allocator is not conventional in Zig code. This wasn't causing any issues from what I can see, but it is still good to follow the conventions. The solution is to store a copy of the allocator in an *Allocator stored on the heap. This is done in the Lua.init function. That allocator is then retrieved during Lua.deinit by calling c.lua_getallocf to get the allocator pointer stored on the heap. Closes #106
Any ziglua.wrap supported function that has a *Lua parameter now allows using error unions in the return type. Any Zig errors that are returned will be raised as a Lua error. Closes #47
This is already covered by Lua.deinit()
Still a work in progress See #25
This is better than an out parameter
Refactors call, callCont, protectedCall, and protectedCallCont to accept a struct of arguments rather than parameters. This improves documentation at the call site.
a9bb920
to
4a22eb7
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
the type of
unwind_tables
changed from?bool
toenum { none, sync, @"async" }
; this PR changesluajit.zig
to accommodate this change.NB – i'm not familiar with
libunwind
and it is not clear to me whethersync
or@"async"
is the correct choice! I went withsync
because the Zig compiler appears to fall back to that if it needs to.