mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 05:44:20 +00:00
std.Build: improve error for peak RSS exceeding declared value
As well as the exact byte count, include a human-readable value so it's clearer what the error is actually telling you. The exact byte count might not be worth keeping, but I decided I would in case it's useful in any scenario.
This commit is contained in:
parent
f758b97bfd
commit
d835a6ba9a
1 changed files with 1 additions and 1 deletions
|
|
@ -271,7 +271,7 @@ pub fn make(s: *Step, options: MakeOptions) error{ MakeFailed, MakeSkipped }!voi
|
|||
}
|
||||
|
||||
if (s.max_rss != 0 and s.result_peak_rss > s.max_rss) {
|
||||
const msg = std.fmt.allocPrint(arena, "memory usage peaked at {d} bytes, exceeding the declared upper bound of {d}", .{
|
||||
const msg = std.fmt.allocPrint(arena, "memory usage peaked at {0B:.2} ({0d} bytes), exceeding the declared upper bound of {1B:.2} ({1d} bytes)", .{
|
||||
s.result_peak_rss, s.max_rss,
|
||||
}) catch @panic("OOM");
|
||||
s.result_error_msgs.append(arena, msg) catch @panic("OOM");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue