diff --git a/BRANCH_TODO b/BRANCH_TODO deleted file mode 100644 index c6b3c8d8b3e8badd50c0891351d9d0ebc7036fa0..0000000000000000000000000000000000000000 --- a/BRANCH_TODO +++ /dev/null @@ -1,3 +0,0 @@ - * wasi behavior tests failing - * go ahead and use allocSentinel now that the stage1 bug is fixed - * audit the base cache hash diff --git a/lib/std/mem/Allocator.zig b/lib/std/mem/Allocator.zig index 326a73b915af8a6af41fc3160561be61ce148898..4511acb27502ab1b31ffd094829df2ac9ab1cd27 100644 --- a/lib/std/mem/Allocator.zig +++ b/lib/std/mem/Allocator.zig @@ -231,8 +231,6 @@ fn AllocWithOptionsPayload(comptime Elem: type, comptime alignment: ?u29, compti /// call `free` when done. /// /// For allocating a single item, see `create`. -/// -/// Deprecated; use `allocWithOptions`. pub fn allocSentinel( self: *Allocator, comptime Elem: type, diff --git a/src/link/Coff.zig b/src/link/Coff.zig index 0356a327baa11c56446af3a562276f7ba38f560b..424ece511bab185133e5a2c2dea8617de0e32b9d 100644 --- a/src/link/Coff.zig +++ b/src/link/Coff.zig @@ -1118,9 +1118,7 @@ fn linkWithLLD(self: *Coff, comp: *Compilation) !void { Compilation.dump_argv(argv.items); } - const new_argv_with_sentinel = try arena.alloc(?[*:0]const u8, argv.items.len + 1); - new_argv_with_sentinel[argv.items.len] = null; - const new_argv = new_argv_with_sentinel[0..argv.items.len :null]; + const new_argv = try arena.allocSentinel(?[*:0]const u8, argv.items.len, null); for (argv.items) |arg, i| { new_argv[i] = try arena.dupeZ(u8, arg); } diff --git a/src/link/Elf.zig b/src/link/Elf.zig index dc664b14be7a47f496ce394dd333616593ae8375..38b9b1acca1f2616e0e6e6541fbcc5abeb3a33e5 100644 --- a/src/link/Elf.zig +++ b/src/link/Elf.zig @@ -1589,10 +1589,7 @@ fn linkWithLLD(self: *Elf, comp: *Compilation) !void { } // Oh, snapplesauce! We need null terminated argv. - // TODO allocSentinel crashed stage1 so this is working around it. - const new_argv_with_sentinel = try arena.alloc(?[*:0]const u8, argv.items.len + 1); - new_argv_with_sentinel[argv.items.len] = null; - const new_argv = new_argv_with_sentinel[0..argv.items.len: null]; + const new_argv = try arena.allocSentinel(?[*:0]const u8, argv.items.len, null); for (argv.items) |arg, i| { new_argv[i] = try arena.dupeZ(u8, arg); } diff --git a/src/link/MachO.zig b/src/link/MachO.zig index 146f2616c22927c2c8c6b3bc6f525c040eac6268..2570a92daa0eadaff0cfa7e368c6f87422d80b48 100644 --- a/src/link/MachO.zig +++ b/src/link/MachO.zig @@ -567,10 +567,7 @@ fn linkWithLLD(self: *MachO, comp: *Compilation) !void { Compilation.dump_argv(argv.items); } - // TODO allocSentinel crashed stage1 so this is working around it. - const new_argv_with_sentinel = try arena.alloc(?[*:0]const u8, argv.items.len + 1); - new_argv_with_sentinel[argv.items.len] = null; - const new_argv = new_argv_with_sentinel[0..argv.items.len :null]; + const new_argv = try arena.allocSentinel(?[*:0]const u8, argv.items.len, null); for (argv.items) |arg, i| { new_argv[i] = try arena.dupeZ(u8, arg); } diff --git a/src/link/Wasm.zig b/src/link/Wasm.zig index 509544c94fbf39fe41455da821918f62bd1178ad..3f879a3b3234e0c6bfe60d6a93abcfe4e1fca12f 100644 --- a/src/link/Wasm.zig +++ b/src/link/Wasm.zig @@ -385,10 +385,7 @@ fn linkWithLLD(self: *Wasm, comp: *Compilation) !void { Compilation.dump_argv(argv.items); } - // TODO allocSentinel crashed stage1 so this is working around it. - const new_argv_with_sentinel = try arena.alloc(?[*:0]const u8, argv.items.len + 1); - new_argv_with_sentinel[argv.items.len] = null; - const new_argv = new_argv_with_sentinel[0..argv.items.len :null]; + const new_argv = try arena.allocSentinel(?[*:0]const u8, argv.items.len, null); for (argv.items) |arg, i| { new_argv[i] = try arena.dupeZ(u8, arg); }