std.Thread: refining stack size from platform minimum, changes more targetted towards platform like Linux/musl (#15791)

This commit is contained in:
David CARLIER
2023-05-25 20:32:17 +01:00
committed by GitHub
parent 230ea411f7
commit 41502c6aa5
12 changed files with 48 additions and 1 deletions

View File

@@ -690,7 +690,7 @@ const PosixThreadImpl = struct {
defer assert(c.pthread_attr_destroy(&attr) == .SUCCESS);
// Use the same set of parameters used by the libc-less impl.
const stack_size = std.math.max(config.stack_size, 16 * 1024);
const stack_size = std.math.max(config.stack_size, c.PTHREAD_STACK_MIN);
assert(c.pthread_attr_setstacksize(&attr, stack_size) == .SUCCESS);
assert(c.pthread_attr_setguardsize(&attr, std.mem.page_size) == .SUCCESS);