-
-
Notifications
You must be signed in to change notification settings - Fork 358
Update for breaking Zig Allocator API change #2179
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
Conversation
c7b626b
to
b1f3bc4
Compare
Hi I am new to zig and zls and was about to open a PR with the same changes (my first try to contribute in the zig ecosystem), but @mochalins has been quicker ! My changes just have the difference highlighted in my previous comments. I don't want to open a conflicting PR so just take my suggestions if you want to |
Thank you for the suggestions @bullekeup ! I hadn't noticed that helper function for alignment. I'd love to incorporate your suggestion, but it'd be even better if you would show up in the commit history to get proper credit; would you mind opening a PR against my fork branch so that I can accept it and have your commit show up here? |
fca2b30
to
d42d3db
Compare
Requires one more update to handle latest changes from master; will fix shortly. |
…zig std allocator convention
d42d3db
to
a120342
Compare
The `popOrNull`->`pop` changes affect `master` build runner. Minimum runtime Zig version must be updated accordingly.
The latest changes to I wasn't able to keep the build runner to one Are these changes acceptable? |
A new allocator (std.heap.SmpAllocator) has been recently add to the standard library. I would rather have ZLS use it instead of the binned allocator.
ZLS has been comparing zig versions at comptime for a while now without issues. I tested the following change which worked for me: - while (stack.popOrNull()) |step| {
+ while (switch (comptime builtin.zig_version.order(std.SemanticVersion.parse("0.14.0-dev.3181+914248237") catch unreachable)) {
+ .lt => stack.popOrNull(),
+ .eq, .gt => stack.pop(),
+ }) |step| { This could be happening because the To not delay these changes any further, I will apply them myself but I still appreciate all the effort you have put into this PR. |
Updates ZLS to compile and pass tests with the ziglang/zig#20511 PR merged in Zig master.
Of note is the new
remap
function in the binned allocator; it simply callsresize
internally à laremap
functions introduced for several allocators in the Zig standard library (see e.g.FixedBufferAllocator
), in the aforementioned PR.This can also be replaced with a naive implementation that copies
resize
, but internally calling the underlying allocator'sremap
. I can make this change upon request, or this can be left for a followup PR (potentially leaving room for an entirely different implementation to make use ofremap
's looser guarantees).Also includes the minor
popOrNull
->pop
change in ziglang/zig#22721