aboutsummaryrefslogtreecommitdiff
path: root/src/thread_pool.zig
diff options
context:
space:
mode:
authorGravatar Dylan Conway <35280289+dylan-conway@users.noreply.github.com> 2023-06-21 23:38:18 -0700
committerGravatar GitHub <noreply@github.com> 2023-06-21 23:38:18 -0700
commit5fa13625a1ca0ea1a3a1c5bb86d0880dcfac349f (patch)
tree97f669a178e60772038751d690c3e298a63557b2 /src/thread_pool.zig
parentbfb322d618a3f0e9618d311ae69016fe7a08e771 (diff)
downloadbun-5fa13625a1ca0ea1a3a1c5bb86d0880dcfac349f.tar.gz
bun-5fa13625a1ca0ea1a3a1c5bb86d0880dcfac349f.tar.zst
bun-5fa13625a1ca0ea1a3a1c5bb86d0880dcfac349f.zip
upgrade zig to `v0.11.0-dev.3737+9eb008717` (#3374)
* progress * finish `@memset/@memcpy` update * Update build.zig * change `@enumToInt` to `@intFromEnum` and friends * update zig versions * it was 1 * add link to issue * add `compileError` reminder * fix merge * format * upgrade to llvm 16 * Revert "upgrade to llvm 16" This reverts commit cc930ceb1c5b4db9614a7638596948f704544ab8. --------- Co-authored-by: Jarred Sumner <jarred@jarredsumner.com> Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Diffstat (limited to 'src/thread_pool.zig')
-rw-r--r--src/thread_pool.zig12
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;
}