Do not set stack limit at runtime (#19405)

This commit is contained in:
Jarred Sumner
2025-04-30 16:12:12 -07:00
committed by GitHub
parent 7e63a7e228
commit d60fcefc0c

View File

@@ -810,19 +810,6 @@ pub const FileSystem = struct {
return std.math.maxInt(usize);
}
blk: {
const resource = std.posix.rlimit_resource.STACK;
const limit = try std.posix.getrlimit(resource);
Limit.stack_before = limit;
if (limit.cur < limit.max) {
var new_limit = std.mem.zeroes(std.posix.rlimit);
new_limit.cur = limit.max;
new_limit.max = limit.max;
std.posix.setrlimit(resource, new_limit) catch break :blk;
Limit.stack = limit.max;
}
}
var file_limit: usize = 0;
blk: {
const resource = std.posix.rlimit_resource.NOFILE;