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.
This commit is contained in:
Andrew Kelley 2020-08-11 14:04:08 -07:00
parent 6febe7e977
commit 3ccfd58bb6

View File

@ -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);