diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2023-07-31 10:54:35 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2023-07-31 10:54:35 -0700 |
| commit | 1b9ffa0824198fc72b085ad99e9f27ad6f533f3a (patch) | |
| tree | 03382a1f770b1a5d0f4d1da221fa095be04383a1 /lib/std | |
| parent | ba3b3528914f8e886b5fe2cba714de34c176a921 (diff) | |
| download | zig-1b9ffa0824198fc72b085ad99e9f27ad6f533f3a.tar.gz zig-1b9ffa0824198fc72b085ad99e9f27ad6f533f3a.zip | |
Revert "std.Thread: refining stack size from platform minimum, changes more targetted towards platform like Linux/musl (#15791)"
This reverts commit 41502c6aa53a3da31b276c23c4db74db7d04796b.
Diffstat (limited to 'lib/std')
| -rw-r--r-- | lib/std/Thread.zig | 2 | ||||
| -rw-r--r-- | lib/std/c/darwin.zig | 6 | ||||
| -rw-r--r-- | lib/std/c/dragonfly.zig | 2 | ||||
| -rw-r--r-- | lib/std/c/emscripten.zig | 2 | ||||
| -rw-r--r-- | lib/std/c/freebsd.zig | 6 | ||||
| -rw-r--r-- | lib/std/c/haiku.zig | 3 | ||||
| -rw-r--r-- | lib/std/c/linux.zig | 12 | ||||
| -rw-r--r-- | lib/std/c/minix.zig | 2 | ||||
| -rw-r--r-- | lib/std/c/netbsd.zig | 3 | ||||
| -rw-r--r-- | lib/std/c/openbsd.zig | 7 | ||||
| -rw-r--r-- | lib/std/c/solaris.zig | 2 | ||||
| -rw-r--r-- | lib/std/c/wasi.zig | 2 |
12 files changed, 1 insertions, 48 deletions
diff --git a/lib/std/Thread.zig b/lib/std/Thread.zig index 64815bde72..ff4f7e8f49 100644 --- a/lib/std/Thread.zig +++ b/lib/std/Thread.zig @@ -695,7 +695,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 = @max(config.stack_size, c.PTHREAD_STACK_MIN); + const stack_size = @max(config.stack_size, 16 * 1024); assert(c.pthread_attr_setstacksize(&attr, stack_size) == .SUCCESS); assert(c.pthread_attr_setguardsize(&attr, std.mem.page_size) == .SUCCESS); diff --git a/lib/std/c/darwin.zig b/lib/std/c/darwin.zig index afa50c4286..b9fc59a1a7 100644 --- a/lib/std/c/darwin.zig +++ b/lib/std/c/darwin.zig @@ -4153,9 +4153,3 @@ pub const vm_extmod_statistics_t = *vm_extmod_statistics; pub const vm_extmod_statistics_data_t = vm_extmod_statistics; pub extern "c" fn vm_stats(info: ?*anyopaque, count: *c_uint) kern_return_t; - -/// TODO refines if necessary -pub const PTHREAD_STACK_MIN = switch (builtin.cpu.arch) { - .arm, .aarch64 => 16 * 1024, - else => 8 * 1024, -}; diff --git a/lib/std/c/dragonfly.zig b/lib/std/c/dragonfly.zig index 52d37811dd..bf14372e9f 100644 --- a/lib/std/c/dragonfly.zig +++ b/lib/std/c/dragonfly.zig @@ -1160,5 +1160,3 @@ pub const sigevent = extern struct { sigev_value: sigval, sigev_notify_function: ?*const fn (sigval) callconv(.C) void, }; - -pub const PTHREAD_STACK_MIN = 16 * 1024; diff --git a/lib/std/c/emscripten.zig b/lib/std/c/emscripten.zig index 8b9fd8c2a2..0d78d4d73f 100644 --- a/lib/std/c/emscripten.zig +++ b/lib/std/c/emscripten.zig @@ -9,5 +9,3 @@ pub const pthread_rwlock_t = extern struct { }; const __SIZEOF_PTHREAD_COND_T = 48; const __SIZEOF_PTHREAD_MUTEX_T = 28; - -pub const PTHREAD_STACK_MIN = 2048; diff --git a/lib/std/c/freebsd.zig b/lib/std/c/freebsd.zig index 8c7548e174..c2288b21b2 100644 --- a/lib/std/c/freebsd.zig +++ b/lib/std/c/freebsd.zig @@ -2818,9 +2818,3 @@ pub const ptrace_cs_remote = extern struct { }; pub extern "c" fn ptrace(request: c_int, pid: pid_t, addr: [*:0]u8, data: c_int) c_int; - -/// TODO refines if necessary -pub const PTHREAD_STACK_MIN = switch (builtin.cpu.arch) { - .x86, .powerpc => 4 * 512, - else => 4 * 1024, -}; diff --git a/lib/std/c/haiku.zig b/lib/std/c/haiku.zig index 7aba395b75..e8e5ac70e0 100644 --- a/lib/std/c/haiku.zig +++ b/lib/std/c/haiku.zig @@ -1068,6 +1068,3 @@ pub const sigevent = extern struct { sigev_notify_function: ?*const fn (sigval) callconv(.C) void, sigev_notify_attributes: ?*pthread_attr_t, }; - -/// TODO refines if necessary -pub const PTHREAD_STACK_MIN = 2 * 4096; diff --git a/lib/std/c/linux.zig b/lib/std/c/linux.zig index 09f744ee17..d392a5ca72 100644 --- a/lib/std/c/linux.zig +++ b/lib/std/c/linux.zig @@ -350,18 +350,6 @@ const __SIZEOF_PTHREAD_MUTEX_T = switch (native_abi) { }; const __SIZEOF_SEM_T = 4 * @sizeOf(usize); -/// TODO refines if necessary -pub const PTHREAD_STACK_MIN = switch (native_abi) { - .musl, .musleabi, .musleabihf => 2048, - .gnu, .gnuabin32, .gnuabi64, .gnueabi, .gnueabihf, .gnux32 => switch (native_arch) { - .aarch64, .arm, .armeb, .powerpc, .powerpc64, .powerpc64le, .loongarch32, .loongarch64 => 131072, - .sparc64 => 24576, - else => 16 * 1024, - }, - .android => if (@sizeOf(usize) == 8) 16 * 1024 else 8 * 1024, - else => 16 * 1024, -}; - pub extern "c" fn pthread_setname_np(thread: std.c.pthread_t, name: [*:0]const u8) E; pub extern "c" fn pthread_getname_np(thread: std.c.pthread_t, name: [*:0]u8, len: usize) E; diff --git a/lib/std/c/minix.zig b/lib/std/c/minix.zig index 672f36ca86..62cefc14fb 100644 --- a/lib/std/c/minix.zig +++ b/lib/std/c/minix.zig @@ -16,5 +16,3 @@ const __SIZEOF_PTHREAD_MUTEX_T = switch (builtin.abi) { }, else => unreachable, }; - -pub const PTHREAD_STACK_MIN = 16 * 1024; diff --git a/lib/std/c/netbsd.zig b/lib/std/c/netbsd.zig index 0ada556436..8b7c1afbbf 100644 --- a/lib/std/c/netbsd.zig +++ b/lib/std/c/netbsd.zig @@ -1720,6 +1720,3 @@ pub const PIOD = struct { }; pub extern "c" fn ptrace(request: c_int, pid: pid_t, addr: ?*anyopaque, data: c_int) c_int; - -/// TODO refines if necessary -pub const PTHREAD_STACK_MIN = 16 * 1024; diff --git a/lib/std/c/openbsd.zig b/lib/std/c/openbsd.zig index 314dcf74ba..7496a85a5e 100644 --- a/lib/std/c/openbsd.zig +++ b/lib/std/c/openbsd.zig @@ -1634,10 +1634,3 @@ pub const HW = struct { pub const NCPUONLINE = 25; pub const POWER = 26; }; - -/// TODO refines if necessary -pub const PTHREAD_STACK_MIN = switch (builtin.cpu.arch) { - .sparc64 => 1 << 13, - .mips64 => 1 << 14, - else => 1 << 12, -}; diff --git a/lib/std/c/solaris.zig b/lib/std/c/solaris.zig index 576d12e9c8..4f81952374 100644 --- a/lib/std/c/solaris.zig +++ b/lib/std/c/solaris.zig @@ -1946,5 +1946,3 @@ pub const sigevent = extern struct { sigev_notify_function: ?*const fn (sigval) callconv(.C) void, sigev_notify_attributes: ?*pthread_attr_t, }; - -pub const PTHREAD_STACK_MIN = if (@sizeOf(usize) == 8) 8 * 1024 else 4 * 1024; diff --git a/lib/std/c/wasi.zig b/lib/std/c/wasi.zig index 2cb0a32b06..e1940054b6 100644 --- a/lib/std/c/wasi.zig +++ b/lib/std/c/wasi.zig @@ -119,5 +119,3 @@ pub const POLL = struct { pub const HUP = 0x2000; pub const NVAL = 0x4000; }; - -pub const PTHREAD_STACK_MIN = 16 * 1024; |
