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

FIX resize() for non u8 element types. #9806

Merged
merged 4 commits into from Sep 22, 2021
Merged

Conversation

colemanbroad
Copy link
Contributor

Looks like a simple typo that breaks resize() on slices of non u8 types?

Fixes, e.g.

  var pts = try gpa.allocator.alloc(f32,100);
  pts = try gpa.allocator.resize(pts, pts.len+1);

Copy link
Member

@Vexu Vexu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch but needs a test so it doesn't regress again, mem.zig would probably be a good place to add one to.

@colemanbroad
Copy link
Contributor Author

OK, cool. Thanks for the review. I'll use testing.allocator I guess?

@colemanbroad
Copy link
Contributor Author

So the ziglang.zig check fails on Linux only. The log appears to show a problem with zig fmt --check. I tried with running code through zig fmt, but that doesn't seem to solve it. Now I'm stuck ;)

@Vexu
Copy link
Member

Vexu commented Sep 21, 2021

How recent is your zig? You might be formatting with an outdated version.

@colemanbroad
Copy link
Contributor Author

OK, That's probably the issue. I'm using 0.8.1. Is there an easy way to format with latest? Or should I bite the bullet and build from source?

@colemanbroad
Copy link
Contributor Author

OK, nvm i see master branch builds are available on the downloads page ;)

@Vexu Vexu merged commit e14fcd6 into ziglang:master Sep 22, 2021
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.

None yet

2 participants