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,