From 525f341f33af9b8aad53931fd5511f00a82cb090 Mon Sep 17 00:00:00 2001 From: Jacob Young Date: Sat, 15 Jun 2024 16:10:53 -0400 Subject: Zcu: introduce `PerThread` and pass to all the functions --- src/main.zig | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/main.zig') diff --git a/src/main.zig b/src/main.zig index 3ba1276abf..9fd9087b63 100644 --- a/src/main.zig +++ b/src/main.zig @@ -172,7 +172,7 @@ pub fn main() anyerror!void { } // We would prefer to use raw libc allocator here, but cannot // use it if it won't support the alignment we need. - if (@alignOf(std.c.max_align_t) < @alignOf(i128)) { + if (@alignOf(std.c.max_align_t) < @max(@alignOf(i128), std.atomic.cache_line)) { break :gpa std.heap.c_allocator; } break :gpa std.heap.raw_c_allocator; @@ -3092,7 +3092,7 @@ fn buildOutputType( defer emit_implib_resolved.deinit(); var thread_pool: ThreadPool = undefined; - try thread_pool.init(.{ .allocator = gpa }); + try thread_pool.init(.{ .allocator = gpa, .track_ids = true }); defer thread_pool.deinit(); var cleanup_local_cache_dir: ?fs.Dir = null; @@ -4895,7 +4895,7 @@ fn cmdBuild(gpa: Allocator, arena: Allocator, args: []const []const u8) !void { child_argv.items[argv_index_cache_dir] = local_cache_directory.path orelse cwd_path; var thread_pool: ThreadPool = undefined; - try thread_pool.init(.{ .allocator = gpa }); + try thread_pool.init(.{ .allocator = gpa, .track_ids = true }); defer thread_pool.deinit(); // Dummy http client that is not actually used when only_core_functionality is enabled. @@ -5329,7 +5329,7 @@ fn jitCmd( defer global_cache_directory.handle.close(); var thread_pool: ThreadPool = undefined; - try thread_pool.init(.{ .allocator = gpa }); + try thread_pool.init(.{ .allocator = gpa, .track_ids = true }); defer thread_pool.deinit(); var child_argv: std.ArrayListUnmanaged([]const u8) = .{}; -- cgit v1.2.3