authorgravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2026-07-02 09:16:49+01:00
committergravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2026-07-02 09:16:49+01:00
log2a235aac2be87c2535f0ae2826b53b43bc541297
treef709cd4f92fdff5b3a27e584ee12dd1d11d832ba
parente155bdb108a72d9fe9a633a512b9f7e4873d2723
signaturelock-open Commit is signed but in an unrecognized format.

link.MappedFile: remove `verify` calls

These were accidentally added in the recent `link.Coff` changes. This function should only be used to debug the `MappedFile` implementation, because it is *extremely* slow---these calls meant that building the compiler using `Elf2` was taking around 10 times longer than before!

1 files changed, 0 insertions(+), 4 deletions(-)

src/link/MappedFile.zig-4
...@@ -337,7 +337,6 @@ pub const Node = extern struct {...@@ -337,7 +337,6 @@ pub const Node = extern struct {
337 }337 }
338338
339 pub fn resize(ni: Node.Index, mf: *MappedFile, gpa: std.mem.Allocator, size: u64) Error!void {339 pub fn resize(ni: Node.Index, mf: *MappedFile, gpa: std.mem.Allocator, size: u64) Error!void {
340 defer if (std.debug.runtime_safety) mf.verify();
341 mf.resizeNode(gpa, ni, size) catch |err| switch (err) {340 mf.resizeNode(gpa, ni, size) catch |err| switch (err) {
342 error.OutOfMemory,341 error.OutOfMemory,
343 error.Canceled,342 error.Canceled,
...@@ -731,7 +730,6 @@ fn shrinkNode(...@@ -731,7 +730,6 @@ fn shrinkNode(
731730
732 // This would require unmapping first731 // This would require unmapping first
733 assert(ni != Node.Index.root);732 assert(ni != Node.Index.root);
734 defer if (std.debug.runtime_safety) mf.verify();
735733
736 if (node.last != .none) {734 if (node.last != .none) {
737 const last = node.last.get(mf);735 const last = node.last.get(mf);
...@@ -1053,8 +1051,6 @@ fn realignNode(...@@ -1053,8 +1051,6 @@ fn realignNode(
10531051
1054 assert(new_alignment.compare(.gt, node.flags.alignment));1052 assert(new_alignment.compare(.gt, node.flags.alignment));
10551053
1056 defer if (std.debug.runtime_safety) mf.verify();
1057
1058 const prev_alignment = node.flags.alignment;1054 const prev_alignment = node.flags.alignment;
1059 node.flags.alignment = new_alignment;1055 node.flags.alignment = new_alignment;
1060 defer {1056 defer {