| author | |
| committer | |
| log | 87528630ddf4182594f6f3554d9d6c1fd550e261 |
| tree | f383a038179f9366058f93bdfa1a11d8494f04d3 |
| parent | 8d6eb13c725f409270fc34c104da4c206b70c376 |
8 files changed, 55 insertions(+), 55 deletions(-)
lib/std/debug/Dwarf.zig+3-3| ... | ... | @@ -571,8 +571,8 @@ fn scanAllCompileUnits(di: *Dwarf, gpa: Allocator, endian: Endian) ScanError!voi |
| 571 | 571 | var fr: Reader = .fixed(di.section(.debug_info).?); |
| 572 | 572 | var this_unit_offset: u64 = 0; |
| 573 | 573 | |
| 574 | var attrs_buf = std.array_list.Managed(Die.Attr).init(gpa); | |
| 575 | defer attrs_buf.deinit(); | |
| 574 | var attrs_buf: std.ArrayList(Die.Attr) = .empty; | |
| 575 | defer attrs_buf.deinit(gpa); | |
| 576 | 576 | |
| 577 | 577 | while (this_unit_offset < fr.buffer.len) { |
| 578 | 578 | fr.seek = @intCast(this_unit_offset); |
| ... | ... | @@ -603,7 +603,7 @@ fn scanAllCompileUnits(di: *Dwarf, gpa: Allocator, endian: Endian) ScanError!voi |
| 603 | 603 | for (abbrev_table.abbrevs) |abbrev| { |
| 604 | 604 | max_attrs = @max(max_attrs, abbrev.attrs.len); |
| 605 | 605 | } |
| 606 | try attrs_buf.resize(max_attrs); | |
| 606 | try attrs_buf.resize(gpa, max_attrs); | |
| 607 | 607 | |
| 608 | 608 | var compile_unit_die = (try parseDie( |
| 609 | 609 | &fr, |
lib/std/hash_map.zig+6-6| ... | ... | @@ -1802,15 +1802,15 @@ test "put and remove loop in random order" { |
| 1802 | 1802 | var map = AutoHashMap(u32, u32).init(std.testing.allocator); |
| 1803 | 1803 | defer map.deinit(); |
| 1804 | 1804 | |
| 1805 | var keys = std.array_list.Managed(u32).init(std.testing.allocator); | |
| 1806 | defer keys.deinit(); | |
| 1805 | var keys: std.ArrayList(u32) = .empty; | |
| 1806 | defer keys.deinit(std.testing.allocator); | |
| 1807 | 1807 | |
| 1808 | 1808 | const size = 32; |
| 1809 | 1809 | const iterations = 100; |
| 1810 | 1810 | |
| 1811 | 1811 | var i: u32 = 0; |
| 1812 | 1812 | while (i < size) : (i += 1) { |
| 1813 | try keys.append(i); | |
| 1813 | try keys.append(std.testing.allocator, i); | |
| 1814 | 1814 | } |
| 1815 | 1815 | var prng = std.Random.DefaultPrng.init(std.testing.random_seed); |
| 1816 | 1816 | const random = prng.random(); |
| ... | ... | @@ -1836,12 +1836,12 @@ test "remove many elements in random order" { |
| 1836 | 1836 | var map = Map.init(std.heap.page_allocator); |
| 1837 | 1837 | defer map.deinit(); |
| 1838 | 1838 | |
| 1839 | var keys = std.array_list.Managed(u32).init(std.heap.page_allocator); | |
| 1840 | defer keys.deinit(); | |
| 1839 | var keys: std.ArrayList(u32) = .empty; | |
| 1840 | defer keys.deinit(std.heap.page_allocator); | |
| 1841 | 1841 | |
| 1842 | 1842 | var i: u32 = 0; |
| 1843 | 1843 | while (i < n) : (i += 1) { |
| 1844 | keys.append(i) catch unreachable; | |
| 1844 | keys.append(std.heap.page_allocator, i) catch unreachable; | |
| 1845 | 1845 | } |
| 1846 | 1846 | |
| 1847 | 1847 | var prng = std.Random.DefaultPrng.init(std.testing.random_seed); |
lib/std/http/test.zig+9-9| ... | ... | @@ -336,17 +336,17 @@ test "Server.Request.respondStreaming non-chunked, unknown content-length" { |
| 336 | 336 | const response = try stream_reader.interface.allocRemaining(gpa, .unlimited); |
| 337 | 337 | defer gpa.free(response); |
| 338 | 338 | |
| 339 | var expected_response = std.array_list.Managed(u8).init(gpa); | |
| 340 | defer expected_response.deinit(); | |
| 339 | var expected_response: std.ArrayList(u8) = .empty; | |
| 340 | defer expected_response.deinit(gpa); | |
| 341 | 341 | |
| 342 | try expected_response.appendSlice("HTTP/1.1 200 OK\r\nconnection: close\r\n\r\n"); | |
| 342 | try expected_response.appendSlice(gpa, "HTTP/1.1 200 OK\r\nconnection: close\r\n\r\n"); | |
| 343 | 343 | |
| 344 | 344 | { |
| 345 | 345 | var total: usize = 0; |
| 346 | 346 | for (0..500) |i| { |
| 347 | 347 | var buf: [30]u8 = undefined; |
| 348 | 348 | const line = try std.mem.print(&buf, "{d}, ah ha ha!\n", .{i}); |
| 349 | try expected_response.appendSlice(line); | |
| 349 | try expected_response.appendSlice(gpa, line); | |
| 350 | 350 | total += line.len; |
| 351 | 351 | } |
| 352 | 352 | try expectEqual(7390, total); |
| ... | ... | @@ -411,12 +411,12 @@ test "receiving arbitrary http headers from the client" { |
| 411 | 411 | const response = try stream_reader.interface.allocRemaining(gpa, .unlimited); |
| 412 | 412 | defer gpa.free(response); |
| 413 | 413 | |
| 414 | var expected_response = std.array_list.Managed(u8).init(gpa); | |
| 415 | defer expected_response.deinit(); | |
| 414 | var expected_response: std.ArrayList(u8) = .empty; | |
| 415 | defer expected_response.deinit(gpa); | |
| 416 | 416 | |
| 417 | try expected_response.appendSlice("HTTP/1.1 200 OK\r\n"); | |
| 418 | try expected_response.appendSlice("connection: close\r\n"); | |
| 419 | try expected_response.appendSlice("content-length: 0\r\n\r\n"); | |
| 417 | try expected_response.appendSlice(gpa, "HTTP/1.1 200 OK\r\n"); | |
| 418 | try expected_response.appendSlice(gpa, "connection: close\r\n"); | |
| 419 | try expected_response.appendSlice(gpa, "content-length: 0\r\n\r\n"); | |
| 420 | 420 | try expectEqualStrings(expected_response.items, response); |
| 421 | 421 | } |
| 422 | 422 |
lib/std/priority_dequeue.zig+4-4| ... | ... | @@ -1020,16 +1020,16 @@ fn fuzzTestMinMax(rng: std.Random, queue_size: usize) !void { |
| 1020 | 1020 | } |
| 1021 | 1021 | |
| 1022 | 1022 | fn generateRandomSlice(allocator: std.mem.Allocator, rng: std.Random, size: usize) ![]u32 { |
| 1023 | var array = std.array_list.Managed(u32).init(allocator); | |
| 1024 | try array.ensureTotalCapacity(size); | |
| 1023 | var array: std.ArrayList(u32) = .empty; | |
| 1024 | try array.ensureTotalCapacity(allocator, size); | |
| 1025 | 1025 | |
| 1026 | 1026 | var i: usize = 0; |
| 1027 | 1027 | while (i < size) : (i += 1) { |
| 1028 | 1028 | const elem = rng.int(u32); |
| 1029 | try array.append(elem); | |
| 1029 | try array.append(allocator, elem); | |
| 1030 | 1030 | } |
| 1031 | 1031 | |
| 1032 | return array.toOwnedSlice(); | |
| 1032 | return array.toOwnedSlice(allocator); | |
| 1033 | 1033 | } |
| 1034 | 1034 | |
| 1035 | 1035 | fn contextLessThanComparison(context: []const u32, a: usize, b: usize) Order { |
lib/std/zig.zig+12-12| ... | ... | @@ -900,10 +900,10 @@ pub fn parseTargetQueryOrReportFatalError( |
| 900 | 900 | return std.Target.Query.parse(opts_with_diags) catch |err| switch (err) { |
| 901 | 901 | error.UnknownCpuModel => { |
| 902 | 902 | help: { |
| 903 | var help_text = std.array_list.Managed(u8).init(allocator); | |
| 904 | defer help_text.deinit(); | |
| 903 | var help_text: std.ArrayList(u8) = .empty; | |
| 904 | defer help_text.deinit(allocator); | |
| 905 | 905 | for (diags.arch.?.allCpuModels()) |cpu| { |
| 906 | help_text.print(" {s}\n", .{cpu.name}) catch break :help; | |
| 906 | help_text.print(allocator, " {s}\n", .{cpu.name}) catch break :help; | |
| 907 | 907 | } |
| 908 | 908 | log.info("available CPUs for architecture '{s}':\n{s}", .{ |
| 909 | 909 | @tagName(diags.arch.?), help_text.items, |
| ... | ... | @@ -913,10 +913,10 @@ pub fn parseTargetQueryOrReportFatalError( |
| 913 | 913 | }, |
| 914 | 914 | error.UnknownCpuFeature => { |
| 915 | 915 | help: { |
| 916 | var help_text = std.array_list.Managed(u8).init(allocator); | |
| 917 | defer help_text.deinit(); | |
| 916 | var help_text: std.ArrayList(u8) = .empty; | |
| 917 | defer help_text.deinit(allocator); | |
| 918 | 918 | for (diags.arch.?.allFeaturesList()) |feature| { |
| 919 | help_text.print(" {s}: {s}\n", .{ feature.name, feature.description }) catch break :help; | |
| 919 | help_text.print(allocator, " {s}: {s}\n", .{ feature.name, feature.description }) catch break :help; | |
| 920 | 920 | } |
| 921 | 921 | log.info("available CPU features for architecture '{s}':\n{s}", .{ |
| 922 | 922 | @tagName(diags.arch.?), help_text.items, |
| ... | ... | @@ -926,10 +926,10 @@ pub fn parseTargetQueryOrReportFatalError( |
| 926 | 926 | }, |
| 927 | 927 | error.UnknownObjectFormat => { |
| 928 | 928 | help: { |
| 929 | var help_text = std.array_list.Managed(u8).init(allocator); | |
| 930 | defer help_text.deinit(); | |
| 929 | var help_text: std.ArrayList(u8) = .empty; | |
| 930 | defer help_text.deinit(allocator); | |
| 931 | 931 | inline for (@typeInfo(std.Target.ObjectFormat).@"enum".field_names) |field_name| { |
| 932 | help_text.print(" {s}\n", .{field_name}) catch break :help; | |
| 932 | help_text.print(allocator, " {s}\n", .{field_name}) catch break :help; | |
| 933 | 933 | } |
| 934 | 934 | log.info("available object formats:\n{s}", .{help_text.items}); |
| 935 | 935 | } |
| ... | ... | @@ -937,10 +937,10 @@ pub fn parseTargetQueryOrReportFatalError( |
| 937 | 937 | }, |
| 938 | 938 | error.UnknownArchitecture => { |
| 939 | 939 | help: { |
| 940 | var help_text = std.array_list.Managed(u8).init(allocator); | |
| 941 | defer help_text.deinit(); | |
| 940 | var help_text: std.ArrayList(u8) = .empty; | |
| 941 | defer help_text.deinit(allocator); | |
| 942 | 942 | inline for (@typeInfo(std.Target.Cpu.Arch).@"enum".field_names) |field_name| { |
| 943 | help_text.print(" {s}\n", .{field_name}) catch break :help; | |
| 943 | help_text.print(allocator, " {s}\n", .{field_name}) catch break :help; | |
| 944 | 944 | } |
| 945 | 945 | log.info("available architectures:\n{s} native\n", .{help_text.items}); |
| 946 | 946 | } |
lib/std/zig/AstGen.zig+3-3| ... | ... | @@ -1802,13 +1802,13 @@ fn structInitExpr( |
| 1802 | 1802 | while (it.next()) |entry| { |
| 1803 | 1803 | const record = entry.value_ptr.*; |
| 1804 | 1804 | if (record.items.len > 1) { |
| 1805 | var error_notes = std.array_list.Managed(u32).init(astgen.arena); | |
| 1805 | var error_notes: std.ArrayList(u32) = .empty; | |
| 1806 | 1806 | |
| 1807 | 1807 | for (record.items[1..]) |duplicate| { |
| 1808 | try error_notes.append(try astgen.errNoteTok(duplicate, "duplicate name here", .{})); | |
| 1808 | try error_notes.append(astgen.arena, try astgen.errNoteTok(duplicate, "duplicate name here", .{})); | |
| 1809 | 1809 | } |
| 1810 | 1810 | |
| 1811 | try error_notes.append(try astgen.errNoteNode(node, "struct declared here", .{})); | |
| 1811 | try error_notes.append(astgen.arena, try astgen.errNoteNode(node, "struct declared here", .{})); | |
| 1812 | 1812 | |
| 1813 | 1813 | try astgen.appendErrorTokNotes( |
| 1814 | 1814 | record.items[0], |
lib/std/zig/LibCDirs.zig+2-2| ... | ... | @@ -96,7 +96,7 @@ pub fn detect( |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | fn detectFromInstallation(arena: Allocator, target: *const std.Target, lci: *const LibCInstallation) !LibCDirs { |
| 99 | var list = try std.array_list.Managed([]const u8).initCapacity(arena, 5); | |
| 99 | var list: std.ArrayList([]const u8) = try .initCapacity(arena, 5); | |
| 100 | 100 | |
| 101 | 101 | list.appendAssumeCapacity(lci.include_dir.?); |
| 102 | 102 | |
| ... | ... | @@ -133,7 +133,7 @@ fn detectFromInstallation(arena: Allocator, target: *const std.Target, lci: *con |
| 133 | 133 | }; |
| 134 | 134 | for (subdirs) |subdir| { |
| 135 | 135 | const path = try std.fs.path.join(arena, &[_][]const u8{ include_dir_path, subdir }); |
| 136 | try list.append(path); | |
| 136 | try list.append(arena, path); | |
| 137 | 137 | } |
| 138 | 138 | } |
| 139 | 139 |
lib/std/zig/llvm/Builder.zig+16-16| ... | ... | @@ -95,8 +95,8 @@ fn subArchName(target: *const std.Target, comptime family: std.Target.Cpu.Arch.F |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | pub fn tripleForTarget(allocator: Allocator, target: *const std.Target) ![]const u8 { |
| 98 | var llvm_triple = std.array_list.Managed(u8).init(allocator); | |
| 99 | defer llvm_triple.deinit(); | |
| 98 | var llvm_triple: std.ArrayList(u8) = .empty; | |
| 99 | defer llvm_triple.deinit(allocator); | |
| 100 | 100 | |
| 101 | 101 | const llvm_arch = switch (target.cpu.arch) { |
| 102 | 102 | .arm => "arm", |
| ... | ... | @@ -168,7 +168,7 @@ pub fn tripleForTarget(allocator: Allocator, target: *const std.Target) ![]const |
| 168 | 168 | => unreachable, // Gated by hasLlvmSupport(). |
| 169 | 169 | }; |
| 170 | 170 | |
| 171 | try llvm_triple.appendSlice(llvm_arch); | |
| 171 | try llvm_triple.appendSlice(allocator, llvm_arch); | |
| 172 | 172 | |
| 173 | 173 | const llvm_sub_arch: ?[]const u8 = switch (target.cpu.arch) { |
| 174 | 174 | .arm, .armeb, .thumb, .thumbeb => subArchName(target, .arm, .{ |
| ... | ... | @@ -223,10 +223,10 @@ pub fn tripleForTarget(allocator: Allocator, target: *const std.Target) ![]const |
| 223 | 223 | else => null, |
| 224 | 224 | }; |
| 225 | 225 | |
| 226 | if (llvm_sub_arch) |sub| try llvm_triple.appendSlice(sub); | |
| 227 | try llvm_triple.append('-'); | |
| 226 | if (llvm_sub_arch) |sub| try llvm_triple.appendSlice(allocator, sub); | |
| 227 | try llvm_triple.append(allocator, '-'); | |
| 228 | 228 | |
| 229 | try llvm_triple.appendSlice(switch (target.os.tag) { | |
| 229 | try llvm_triple.appendSlice(allocator, switch (target.os.tag) { | |
| 230 | 230 | .driverkit, |
| 231 | 231 | .ios, |
| 232 | 232 | .maccatalyst, |
| ... | ... | @@ -248,7 +248,7 @@ pub fn tripleForTarget(allocator: Allocator, target: *const std.Target) ![]const |
| 248 | 248 | => "mesa", |
| 249 | 249 | else => "unknown", |
| 250 | 250 | }); |
| 251 | try llvm_triple.append('-'); | |
| 251 | try llvm_triple.append(allocator, '-'); | |
| 252 | 252 | |
| 253 | 253 | const llvm_os = switch (target.os.tag) { |
| 254 | 254 | .dragonfly => "dragonfly", |
| ... | ... | @@ -298,28 +298,28 @@ pub fn tripleForTarget(allocator: Allocator, target: *const std.Target) ![]const |
| 298 | 298 | .ashetos, |
| 299 | 299 | => "unknown", |
| 300 | 300 | }; |
| 301 | try llvm_triple.appendSlice(llvm_os); | |
| 301 | try llvm_triple.appendSlice(allocator, llvm_os); | |
| 302 | 302 | |
| 303 | 303 | switch (target.os.versionRange()) { |
| 304 | 304 | .none, |
| 305 | 305 | .windows, |
| 306 | 306 | => {}, |
| 307 | 307 | .semver => |ver| if (target.os.tag == .wasi and ver.min.major == 0) { |
| 308 | try llvm_triple.print("p{d}", .{ver.min.minor}); | |
| 308 | try llvm_triple.print(allocator, "p{d}", .{ver.min.minor}); | |
| 309 | 309 | } else if (target.os.tag != .amdhsa) { |
| 310 | try llvm_triple.print("{d}.{d}.{d}", .{ | |
| 310 | try llvm_triple.print(allocator, "{d}.{d}.{d}", .{ | |
| 311 | 311 | ver.min.major, |
| 312 | 312 | ver.min.minor, |
| 313 | 313 | ver.min.patch, |
| 314 | 314 | }); |
| 315 | 315 | }, |
| 316 | inline .linux, .hurd => |ver| try llvm_triple.print("{d}.{d}.{d}", .{ | |
| 316 | inline .linux, .hurd => |ver| try llvm_triple.print(allocator, "{d}.{d}.{d}", .{ | |
| 317 | 317 | ver.range.min.major, |
| 318 | 318 | ver.range.min.minor, |
| 319 | 319 | ver.range.min.patch, |
| 320 | 320 | }), |
| 321 | 321 | } |
| 322 | try llvm_triple.append('-'); | |
| 322 | try llvm_triple.append(allocator, '-'); | |
| 323 | 323 | |
| 324 | 324 | const llvm_abi = switch (target.abi) { |
| 325 | 325 | .none => if (target.os.tag == .maccatalyst) "macabi" else "unknown", |
| ... | ... | @@ -357,7 +357,7 @@ pub fn tripleForTarget(allocator: Allocator, target: *const std.Target) ![]const |
| 357 | 357 | .ohos, .ohoseabi => "ohos", |
| 358 | 358 | .call0 => "unknown", |
| 359 | 359 | }; |
| 360 | try llvm_triple.appendSlice(llvm_abi); | |
| 360 | try llvm_triple.appendSlice(allocator, llvm_abi); | |
| 361 | 361 | |
| 362 | 362 | switch (target.os.versionRange()) { |
| 363 | 363 | .none, |
| ... | ... | @@ -365,17 +365,17 @@ pub fn tripleForTarget(allocator: Allocator, target: *const std.Target) ![]const |
| 365 | 365 | .windows, |
| 366 | 366 | => {}, |
| 367 | 367 | inline .hurd, .linux => |ver| if (target.abi.isGnu()) { |
| 368 | try llvm_triple.print("{d}.{d}.{d}", .{ | |
| 368 | try llvm_triple.print(allocator, "{d}.{d}.{d}", .{ | |
| 369 | 369 | ver.glibc.major, |
| 370 | 370 | ver.glibc.minor, |
| 371 | 371 | ver.glibc.patch, |
| 372 | 372 | }); |
| 373 | 373 | } else if (@TypeOf(ver) == std.Target.Os.LinuxVersionRange and target.abi.isAndroid()) { |
| 374 | try llvm_triple.print("{d}", .{ver.android}); | |
| 374 | try llvm_triple.print(allocator, "{d}", .{ver.android}); | |
| 375 | 375 | }, |
| 376 | 376 | } |
| 377 | 377 | |
| 378 | return llvm_triple.toOwnedSlice(); | |
| 378 | return llvm_triple.toOwnedSlice(allocator); | |
| 379 | 379 | } |
| 380 | 380 | |
| 381 | 381 | pub const DataLayout = struct { |