Extracted from #14647.
Currently, it is enforced post-hoc here:
|
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}", .{ |
|
s.result_peak_rss, s.max_rss, |
|
}) catch @panic("OOM"); |
|
s.result_error_msgs.append(arena, msg) catch @panic("OOM"); |
|
return error.MakeFailed; |
|
} |
Instead, this issue proposes to enforce it using operating system APIs.
I looked briefly into this, and it looked like a giant pain in the ass to do this, at least on Linux.
Extracted from #14647.
Currently, it is enforced post-hoc here:
zig/lib/std/Build/Step.zig
Lines 176 to 182 in b4d58e9
Instead, this issue proposes to enforce it using operating system APIs.
I looked briefly into this, and it looked like a giant pain in the ass to do this, at least on Linux.