From 3ccfd58bb6765bcb6c586e91fd638a8117b4634f Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Tue, 11 Aug 2020 14:04:08 -0700 Subject: [PATCH] std.mem.Allocator: fix not passing return_address This makes collected stack traces omit less useful frames. For user applications which only store a fixed number of stack frames this can make a big difference. --- lib/std/mem/Allocator.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/std/mem/Allocator.zig b/lib/std/mem/Allocator.zig index 8bdab81bc6..e73050165e 100644 --- a/lib/std/mem/Allocator.zig +++ b/lib/std/mem/Allocator.zig @@ -369,7 +369,7 @@ pub fn reallocAdvancedWithRetAddr( const Slice = @typeInfo(@TypeOf(old_mem)).Pointer; const T = Slice.child; if (old_mem.len == 0) { - return self.allocAdvanced(T, new_alignment, new_n, exact); + return self.allocAdvancedWithRetAddr(T, new_alignment, new_n, exact, return_address); } if (new_n == 0) { self.free(old_mem);