-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
make it a compile error to call allocator.destroy
on a non-single-item pointer
#16540
Labels
contributor friendly
This issue is limited in scope and/or knowledge of Zig internals.
enhancement
Solving this issue will likely involve adding new logic or components to the codebase.
standard library
This issue involves writing Zig code for the standard library.
Milestone
Comments
Jarred-Sumner
added
the
error message
This issue points out an error message that is unhelpful and should be improved.
label
Jul 25, 2023
incorrect API usage: test {
var buffer = try @import("std").heap.page_allocator.alloc(u8, 0);
- @import("std").heap.page_allocator.destroy(buffer);
+ @import("std").heap.page_allocator.free(buffer);
}
Lines 109 to 111 in dc24835
|
andrewrk
added
question
No questions on the issue tracker, please.
and removed
error message
This issue points out an error message that is unhelpful and should be improved.
labels
Jul 25, 2023
Why isn't it a compiler error? |
Jarred-Sumner
added a commit
to oven-sh/bun
that referenced
this issue
Jul 25, 2023
andrewrk
added
enhancement
Solving this issue will likely involve adding new logic or components to the codebase.
contributor friendly
This issue is limited in scope and/or knowledge of Zig internals.
standard library
This issue involves writing Zig code for the standard library.
and removed
question
No questions on the issue tracker, please.
labels
Jul 25, 2023
andrewrk
changed the title
make it a compile error to call Jul 25, 2023
allocator.destroy
on a 0-length slice segfaults at runtimeallocator.destroy
on a non-single-item pointer
Jarred-Sumner
added a commit
to oven-sh/bun
that referenced
this issue
Jul 27, 2023
* Make os.cpus() faster on Linux * Fix crash See ziglang/zig#16540 * Handle watcher_count == 0 * Add assertion * Clean up lifetimes of fs watcher a little * ✂️ * Use `errdefer` * Make the error better * Make os.cpus() more lazy * Please don't translate-c on the entire C standard library * immediately closing works correctly is still bug * ops * fmt+fixeup * add back verbose * free instead of destroy * remove destroy option for watcher tasks * flush verbose and add debug log * fixup files * use log for debug --------- Co-authored-by: Jarred Sumner <[email protected]> Co-authored-by: cirospaciari <[email protected]>
trnxdev
pushed a commit
to trnxdev/bun
that referenced
this issue
Aug 9, 2023
* Make os.cpus() faster on Linux * Fix crash See ziglang/zig#16540 * Handle watcher_count == 0 * Add assertion * Clean up lifetimes of fs watcher a little * ✂️ * Use `errdefer` * Make the error better * Make os.cpus() more lazy * Please don't translate-c on the entire C standard library * immediately closing works correctly is still bug * ops * fmt+fixeup * add back verbose * free instead of destroy * remove destroy option for watcher tasks * flush verbose and add debug log * fixup files * use log for debug --------- Co-authored-by: Jarred Sumner <[email protected]> Co-authored-by: cirospaciari <[email protected]>
6 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
contributor friendly
This issue is limited in scope and/or knowledge of Zig internals.
enhancement
Solving this issue will likely involve adding new logic or components to the codebase.
standard library
This issue involves writing Zig code for the standard library.
Zig Version
0.11.0-dev.4006+bf827d0b5
Steps to Reproduce and Observed Output
Failing test:
Expected Output
allocator.destroy(slice)
should be a compiler error sinceallocator.alloc
says to useallocator.free
The text was updated successfully, but these errors were encountered: