Skip to content

Instantly share code, notes, and snippets.

@tshak
Last active February 17, 2024 09:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tshak/dda765ec517dab7f58b77d85e2886cf4 to your computer and use it in GitHub Desktop.
Save tshak/dda765ec517dab7f58b77d85e2886cf4 to your computer and use it in GitHub Desktop.
Zig ArrayList Not Safe :(
const std = @import("std");
pub fn main() !void {
var list = std.ArrayList(u21).init(std.heap.page_allocator);
try list.append(1);
list.deinit();
// Seg fault :(
std.debug.print("{}", .{list.items[0]});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment