authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-02-28 20:37:37-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-02-28 20:38:24-07:00
logf7d095d37267658ba0dc3a7e9c1506a9bbab0b49
tree329861a3d8e8c0a6f8a3a38bf76a197d0f1c5f5a
parent30688f33a46e50877ee83d37bde7b6f0be907522

use hash.addListOfBytes where applicable


2 files changed, 3 insertions(+), 12 deletions(-)

src/Compilation.zig+1-4
......@@ -2584,10 +2584,7 @@ fn addNonIncrementalStuffToCacheManifest(
25842584 man.hash.addOptional(opts.initial_memory);
25852585 man.hash.addOptional(opts.max_memory);
25862586 man.hash.addOptional(opts.global_base);
2587 man.hash.add(opts.export_symbol_names.len);
2588 for (opts.export_symbol_names) |symbol_name| {
2589 man.hash.addBytes(symbol_name);
2590 }
2587 man.hash.addListOfBytes(opts.export_symbol_names);
25912588
25922589 // Mach-O specific stuff
25932590 try link.File.MachO.hashAddFrameworks(man, opts.frameworks);
src/link/Wasm.zig+2-8
......@@ -3535,11 +3535,8 @@ fn linkWithZld(wasm: *Wasm, arena: Allocator, prog_node: *std.Progress.Node) lin
35353535 man.hash.addOptional(wasm.initial_memory);
35363536 man.hash.addOptional(wasm.max_memory);
35373537 man.hash.addOptional(wasm.global_base);
3538 man.hash.add(wasm.export_symbol_names.len);
3538 man.hash.addListOfBytes(wasm.export_symbol_names);
35393539 // strip does not need to go into the linker hash because it is part of the hash namespace
3540 for (wasm.export_symbol_names) |symbol_name| {
3541 man.hash.addBytes(symbol_name);
3542 }
35433540
35443541 // We don't actually care whether it's a cache hit or miss; we just need the digest and the lock.
35453542 _ = try man.hit();
......@@ -4605,11 +4602,8 @@ fn linkWithLLD(wasm: *Wasm, arena: Allocator, prog_node: *std.Progress.Node) !vo
46054602 man.hash.addOptional(wasm.max_memory);
46064603 man.hash.add(shared_memory);
46074604 man.hash.addOptional(wasm.global_base);
4608 man.hash.add(wasm.export_symbol_names.len);
4605 man.hash.addListOfBytes(wasm.export_symbol_names);
46094606 // strip does not need to go into the linker hash because it is part of the hash namespace
4610 for (wasm.export_symbol_names) |symbol_name| {
4611 man.hash.addBytes(symbol_name);
4612 }
46134607
46144608 // We don't actually care whether it's a cache hit or miss; we just need the digest and the lock.
46154609 _ = try man.hit();