authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-08-11 14:04:08-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-08-11 14:04:08-07:00
log3ccfd58bb6765bcb6c586e91fd638a8117b4634f
tree164b9628fb876f43bad2812ea74388609e6b31ce
parent6febe7e977072fea1bf7b6003be2d6c1f3654905

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.

1 files changed, 1 insertions(+), 1 deletions(-)

lib/std/mem/Allocator.zig+1-1
...@@ -369,7 +369,7 @@ pub fn reallocAdvancedWithRetAddr(...@@ -369,7 +369,7 @@ pub fn reallocAdvancedWithRetAddr(
369 const Slice = @typeInfo(@TypeOf(old_mem)).Pointer;369 const Slice = @typeInfo(@TypeOf(old_mem)).Pointer;
370 const T = Slice.child;370 const T = Slice.child;
371 if (old_mem.len == 0) {371 if (old_mem.len == 0) {
372 return self.allocAdvanced(T, new_alignment, new_n, exact);372 return self.allocAdvancedWithRetAddr(T, new_alignment, new_n, exact, return_address);
373 }373 }
374 if (new_n == 0) {374 if (new_n == 0) {
375 self.free(old_mem);375 self.free(old_mem);