diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2023-06-16 13:45:33 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-06-16 13:45:33 -0700 |
| commit | 537104fd9d84d94abad3e36d3cd781be4397e299 (patch) | |
| tree | a77492de657f8a76c15bdeb443916490db79e1cd /lib/std/Thread.zig | |
| parent | 5d9e8f27d0dc131e0b4154c5f65376f2fb9f3500 (diff) | |
| parent | 2af5bd8aa8711b2a6e60f961290372134090f235 (diff) | |
| download | zig-537104fd9d84d94abad3e36d3cd781be4397e299.tar.gz zig-537104fd9d84d94abad3e36d3cd781be4397e299.zip | |
Merge pull request #16025 from mlugg/feat/remove-std-math-minmax
Consider bounds when refining @min/@max result type; deprecate std.math.{min,max,min3,max3}
Diffstat (limited to 'lib/std/Thread.zig')
| -rw-r--r-- | lib/std/Thread.zig | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/std/Thread.zig b/lib/std/Thread.zig index ed6a9383e3..76650a9072 100644 --- a/lib/std/Thread.zig +++ b/lib/std/Thread.zig @@ -541,7 +541,7 @@ const WindowsThreadImpl = struct { // Going lower makes it default to that specified in the executable (~1mb). // Its also fine if the limit here is incorrect as stack size is only a hint. var stack_size = std.math.cast(u32, config.stack_size) orelse std.math.maxInt(u32); - stack_size = std.math.max(64 * 1024, stack_size); + stack_size = @max(64 * 1024, stack_size); instance.thread.thread_handle = windows.kernel32.CreateThread( null, @@ -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, c.PTHREAD_STACK_MIN); + const stack_size = @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); @@ -930,7 +930,7 @@ const LinuxThreadImpl = struct { var bytes: usize = page_size; guard_offset = bytes; - bytes += std.math.max(page_size, config.stack_size); + bytes += @max(page_size, config.stack_size); bytes = std.mem.alignForward(bytes, page_size); stack_offset = bytes; |
