authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-12-01 02:40:00-08:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2021-12-01 02:40:00-08:00
log8c3624313600c307bc101564a81c4035ec923dee
treeb9d25c7c91fe57f17605e6112e694568df79619e
parent8f9d857932dfb3abb97852dacc90c88a613a1b25
parent67ec6e73fb43020c92a4bebe99e2c426f0f5518f
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

Merge pull request #10254 from leecannon/allocgate-perf

Allocgate: fixups

2 files changed, 5 insertions(+), 3 deletions(-)

lib/std/heap/general_purpose_allocator.zig+2
...@@ -627,6 +627,8 @@ pub fn GeneralPurposeAllocator(comptime config: Config) type {...@@ -627,6 +627,8 @@ pub fn GeneralPurposeAllocator(comptime config: Config) type {
627 self.total_requested_bytes -= entry.value_ptr.requested_size;627 self.total_requested_bytes -= entry.value_ptr.requested_size;
628 }628 }
629629
630 if (!config.never_unmap) self.backing_allocator.rawFree(old_mem, old_align, ret_addr);
631
630 if (config.verbose_log) {632 if (config.verbose_log) {
631 log.info("large free {d} bytes at {*}", .{ old_mem.len, old_mem.ptr });633 log.info("large free {d} bytes at {*}", .{ old_mem.len, old_mem.ptr });
632 }634 }
src/Module.zig+3-3
...@@ -4775,10 +4775,10 @@ pub fn populateTestFunctions(mod: *Module) !void {...@@ -4775,10 +4775,10 @@ pub fn populateTestFunctions(mod: *Module) !void {
4775 const test_name_decl = n: {4775 const test_name_decl = n: {
4776 var name_decl_arena = std.heap.ArenaAllocator.init(gpa);4776 var name_decl_arena = std.heap.ArenaAllocator.init(gpa);
4777 errdefer name_decl_arena.deinit();4777 errdefer name_decl_arena.deinit();
4778 const bytes = try arena.dupe(u8, test_name_slice);4778 const bytes = try name_decl_arena.allocator().dupe(u8, test_name_slice);
4779 const test_name_decl = try mod.createAnonymousDeclFromDecl(array_decl, array_decl.src_namespace, null, .{4779 const test_name_decl = try mod.createAnonymousDeclFromDecl(array_decl, array_decl.src_namespace, null, .{
4780 .ty = try Type.Tag.array_u8.create(arena, bytes.len),4780 .ty = try Type.Tag.array_u8.create(name_decl_arena.allocator(), bytes.len),
4781 .val = try Value.Tag.bytes.create(arena, bytes),4781 .val = try Value.Tag.bytes.create(name_decl_arena.allocator(), bytes),
4782 });4782 });
4783 try test_name_decl.finalizeNewArena(&name_decl_arena);4783 try test_name_decl.finalizeNewArena(&name_decl_arena);
4784 break :n test_name_decl;4784 break :n test_name_decl;