diff options
| author | Jacob Young <jacobly0@users.noreply.github.com> | 2025-01-14 17:56:25 -0500 |
|---|---|---|
| committer | Jacob Young <jacobly0@users.noreply.github.com> | 2025-01-16 20:47:30 -0500 |
| commit | 8c8dfb35f398407319764f0f8998de34c5247ed6 (patch) | |
| tree | a5c1fee87a9266319d8ceffa7717ca5c70b61f7b /lib/std | |
| parent | c3d33440f0e68f114996dc74ec15e2b9514c4b3e (diff) | |
| download | zig-8c8dfb35f398407319764f0f8998de34c5247ed6.tar.gz zig-8c8dfb35f398407319764f0f8998de34c5247ed6.zip | |
x86_64: fix crashes compiling the compiler and tests
Diffstat (limited to 'lib/std')
| -rw-r--r-- | lib/std/Thread.zig | 4 | ||||
| -rw-r--r-- | lib/std/Thread/Pool.zig | 6 | ||||
| -rw-r--r-- | lib/std/crypto/aes/aesni.zig | 2 |
3 files changed, 9 insertions, 3 deletions
diff --git a/lib/std/Thread.zig b/lib/std/Thread.zig index 69dbcf3947..9650bf8373 100644 --- a/lib/std/Thread.zig +++ b/lib/std/Thread.zig @@ -372,9 +372,11 @@ pub const SpawnConfig = struct { // https://github.com/ziglang/zig/issues/157 /// Size in bytes of the Thread's stack - stack_size: usize = 16 * 1024 * 1024, + stack_size: usize = default_stack_size, /// The allocator to be used to allocate memory for the to-be-spawned thread allocator: ?std.mem.Allocator = null, + + pub const default_stack_size = 16 * 1024 * 1024; }; pub const SpawnError = error{ diff --git a/lib/std/Thread/Pool.zig b/lib/std/Thread/Pool.zig index 86bac7ce46..874050a35f 100644 --- a/lib/std/Thread/Pool.zig +++ b/lib/std/Thread/Pool.zig @@ -27,6 +27,7 @@ pub const Options = struct { allocator: std.mem.Allocator, n_jobs: ?usize = null, track_ids: bool = false, + stack_size: usize = std.Thread.SpawnConfig.default_stack_size, }; pub fn init(pool: *Pool, options: Options) !void { @@ -54,7 +55,10 @@ pub fn init(pool: *Pool, options: Options) !void { errdefer pool.join(spawned); for (pool.threads) |*thread| { - thread.* = try std.Thread.spawn(.{}, worker, .{pool}); + thread.* = try std.Thread.spawn(.{ + .stack_size = options.stack_size, + .allocator = allocator, + }, worker, .{pool}); spawned += 1; } } diff --git a/lib/std/crypto/aes/aesni.zig b/lib/std/crypto/aes/aesni.zig index 2793ff4184..fbf3e37300 100644 --- a/lib/std/crypto/aes/aesni.zig +++ b/lib/std/crypto/aes/aesni.zig @@ -4,7 +4,7 @@ const mem = std.mem; const debug = std.debug; const has_vaes = builtin.cpu.arch == .x86_64 and std.Target.x86.featureSetHas(builtin.cpu.features, .vaes); -const has_avx512f = builtin.cpu.arch == .x86_64 and std.Target.x86.featureSetHas(builtin.cpu.features, .avx512f); +const has_avx512f = builtin.cpu.arch == .x86_64 and builtin.zig_backend != .stage2_x86_64 and std.Target.x86.featureSetHas(builtin.cpu.features, .avx512f); /// A single AES block. pub const Block = struct { |
