Better comment in debug allocator pointing to a ziglang PR

This commit is contained in:
Alexandros Naskos 2020-06-12 15:52:14 +03:00
parent f792b4036d
commit 481f2c2965

View File

@ -52,11 +52,11 @@ pub const AllocationInfo = struct {
) !void {
@setEvalBranchQuota(2000);
// TODO: Make these behave like {Bi}, which doesnt work on floating point numbers.
// TODO Fix these to use `Bi` and remove toMB once `https://github.com/ziglang/zig/pull/5592` is accepted
return std.fmt.format(
out_stream,
\\------------------------------------------ Allocation info ------------------------------------------
\\{} total allocations (total: {d:.2} MB, mean: {d:.2} MB, std. dev: {d:.2} MB), {} deallocations
\\{} total allocations (total: {d:.2}, mean: {d:.2} MB, std. dev: {d:.2} MB), {} deallocations
\\{} current allocations ({d:.2} MB), peak mem usage: {d:.2} MB
\\{} reallocations (total: {d:.2} MB, mean: {d:.2} MB, std. dev: {d:.2} MB)
\\{} shrinks (total: {d:.2} MB, mean: {d:.2} MB, std. dev: {d:.2} MB)
@ -64,7 +64,7 @@ pub const AllocationInfo = struct {
,
.{
self.allocation_stats.count,
toMB(self.allocation_stats.total),
self.allocation_stats.total,
toMB(self.allocation_stats.mean),
toMB(self.allocation_stats.stdDev()),
self.deallocation_count,