diff options
Diffstat (limited to 'src/thread_pool.zig')
-rw-r--r-- | src/thread_pool.zig | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/thread_pool.zig b/src/thread_pool.zig index b6e766cf9..3359311d6 100644 --- a/src/thread_pool.zig +++ b/src/thread_pool.zig @@ -59,8 +59,8 @@ pub const Config = struct { /// Statically initialize the thread pool using the configuration. pub fn init(config: Config) ThreadPool { return .{ - .stack_size = std.math.max(1, config.stack_size), - .max_threads = std.math.max(1, config.max_threads), + .stack_size = @max(1, config.stack_size), + .max_threads = @max(1, config.max_threads), }; } @@ -945,11 +945,11 @@ pub const Node = struct { var stack = self.stack.load(.Monotonic); while (true) { // Attach the list to the stack (pt. 1) - list.tail.next = @intToPtr(?*Node, stack & PTR_MASK); + list.tail.next = @ptrFromInt(?*Node, stack & PTR_MASK); // Update the stack with the list (pt. 2). // Don't change the HAS_CACHE and IS_CONSUMING bits of the consumer. - var new_stack = @ptrToInt(list.head); + var new_stack = @intFromPtr(list.head); assert(new_stack & ~PTR_MASK == 0); new_stack |= (stack & ~PTR_MASK); @@ -985,7 +985,7 @@ pub const Node = struct { new_stack, .Acquire, .Monotonic, - ) orelse return self.cache orelse @intToPtr(*Node, stack & PTR_MASK); + ) orelse return self.cache orelse @ptrFromInt(*Node, stack & PTR_MASK); } } @@ -1022,7 +1022,7 @@ pub const Node = struct { assert(stack & IS_CONSUMING != 0); assert(stack & PTR_MASK != 0); - const node = @intToPtr(*Node, stack & PTR_MASK); + const node = @ptrFromInt(*Node, stack & PTR_MASK); consumer_ref.* = node.next; return node; } |