| ... | ... | @@ -53,7 +53,7 @@ mutex: std.Thread.Mutex = .{}, |
| 53 | 53 | /// are replaced with single-character indicators. This is not to save |
| 54 | 54 | /// space but to eliminate absolute file paths. This improves portability |
| 55 | 55 | /// and usefulness of the cache for advanced use cases. |
| 56 | | prefixes_buffer: [3]Directory = undefined, |
| 56 | prefixes_buffer: [4]Directory = undefined, |
| 57 | 57 | prefixes_len: usize = 0, |
| 58 | 58 | |
| 59 | 59 | pub const DepTokenizer = @import("Cache/DepTokenizer.zig"); |
| ... | ... | @@ -71,9 +71,6 @@ const Allocator = std.mem.Allocator; |
| 71 | 71 | const log = std.log.scoped(.cache); |
| 72 | 72 | |
| 73 | 73 | pub fn addPrefix(cache: *Cache, directory: Directory) void { |
| 74 | | if (directory.path) |p| { |
| 75 | | log.debug("Cache.addPrefix {d} {s}", .{ cache.prefixes_len, p }); |
| 76 | | } |
| 77 | 74 | cache.prefixes_buffer[cache.prefixes_len] = directory; |
| 78 | 75 | cache.prefixes_len += 1; |
| 79 | 76 | } |
| ... | ... | @@ -120,8 +117,6 @@ fn findPrefixResolved(cache: *const Cache, resolved_path: []u8) !PrefixedPath { |
| 120 | 117 | .prefix = @intCast(u8, i), |
| 121 | 118 | .sub_path = sub_path, |
| 122 | 119 | }; |
| 123 | | } else { |
| 124 | | log.debug("'{s}' does not start with '{s}'", .{ resolved_path, p }); |
| 125 | 120 | } |
| 126 | 121 | } |
| 127 | 122 | |
| ... | ... | @@ -319,10 +314,6 @@ pub const Manifest = struct { |
| 319 | 314 | const prefixed_path = try self.cache.findPrefix(file_path); |
| 320 | 315 | errdefer gpa.free(prefixed_path.sub_path); |
| 321 | 316 | |
| 322 | | log.debug("Manifest.addFile {s} -> {d} {s}", .{ |
| 323 | | file_path, prefixed_path.prefix, prefixed_path.sub_path, |
| 324 | | }); |
| 325 | | |
| 326 | 317 | self.files.addOneAssumeCapacity().* = .{ |
| 327 | 318 | .prefixed_path = prefixed_path, |
| 328 | 319 | .contents = null, |
| ... | ... | @@ -687,10 +678,6 @@ pub const Manifest = struct { |
| 687 | 678 | const prefixed_path = try self.cache.findPrefix(file_path); |
| 688 | 679 | errdefer gpa.free(prefixed_path.sub_path); |
| 689 | 680 | |
| 690 | | log.debug("Manifest.addFilePostFetch {s} -> {d} {s}", .{ |
| 691 | | file_path, prefixed_path.prefix, prefixed_path.sub_path, |
| 692 | | }); |
| 693 | | |
| 694 | 681 | const new_ch_file = try self.files.addOne(gpa); |
| 695 | 682 | new_ch_file.* = .{ |
| 696 | 683 | .prefixed_path = prefixed_path, |
| ... | ... | @@ -717,10 +704,6 @@ pub const Manifest = struct { |
| 717 | 704 | const prefixed_path = try self.cache.findPrefix(file_path); |
| 718 | 705 | errdefer gpa.free(prefixed_path.sub_path); |
| 719 | 706 | |
| 720 | | log.debug("Manifest.addFilePost {s} -> {d} {s}", .{ |
| 721 | | file_path, prefixed_path.prefix, prefixed_path.sub_path, |
| 722 | | }); |
| 723 | | |
| 724 | 707 | const new_ch_file = try self.files.addOne(gpa); |
| 725 | 708 | new_ch_file.* = .{ |
| 726 | 709 | .prefixed_path = prefixed_path, |
| ... | ... | @@ -748,15 +731,9 @@ pub const Manifest = struct { |
| 748 | 731 | const ch_file = try self.files.addOne(gpa); |
| 749 | 732 | errdefer self.files.shrinkRetainingCapacity(self.files.items.len - 1); |
| 750 | 733 | |
| 751 | | log.debug("Manifest.addFilePostContents resolved_path={s}", .{resolved_path}); |
| 752 | | |
| 753 | 734 | const prefixed_path = try self.cache.findPrefixResolved(resolved_path); |
| 754 | 735 | errdefer gpa.free(prefixed_path.sub_path); |
| 755 | 736 | |
| 756 | | log.debug("Manifest.addFilePostContents -> {d} {s}", .{ |
| 757 | | prefixed_path.prefix, prefixed_path.sub_path, |
| 758 | | }); |
| 759 | | |
| 760 | 737 | ch_file.* = .{ |
| 761 | 738 | .prefixed_path = prefixed_path, |
| 762 | 739 | .max_file_size = null, |