zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 6c15c34421bbecb8eba7abf56e277ec26a4f018c (tree)
parent 8f2aa72af7695dc8fba9946b60129a4f615d6727
Author: Jacob Young <jacobly0@users.noreply.github.com>
Date:   Wed,  8 Nov 2023 07:44:48 -0500

MachO: support `-fsingle-threaded` mode

Diffstat:
Msrc/link/MachO/uuid.zig | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/link/MachO/uuid.zig b/src/link/MachO/uuid.zig @@ -5,7 +5,7 @@ /// TODO LLD also hashes the output filename to disambiguate between same builds with different /// output files. Should we also do that? pub fn calcUuid(comp: *const Compilation, file: fs.File, file_size: u64, out: *[Md5.digest_length]u8) !void { - const num_chunks = comp.thread_pool.threads.len * 0x10; + const num_chunks = @max(comp.thread_pool.threads.len, 1) * 0x10; const chunk_size = @divTrunc(file_size, num_chunks); const actual_num_chunks = if (@rem(file_size, num_chunks) > 0) num_chunks + 1 else num_chunks;