From 481f2c29653085366911f55263f60beacd20bb37 Mon Sep 17 00:00:00 2001 From: Alexandros Naskos Date: Fri, 12 Jun 2020 15:52:14 +0300 Subject: [PATCH] Better comment in debug allocator pointing to a ziglang PR --- src/debug_allocator.zig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/debug_allocator.zig b/src/debug_allocator.zig index eac1fe5..96aab0d 100644 --- a/src/debug_allocator.zig +++ b/src/debug_allocator.zig @@ -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,