| ... | @@ -39,7 +39,6 @@ gpa: *Allocator, | ... | @@ -39,7 +39,6 @@ gpa: *Allocator, |
| 39 | arena_state: std.heap.ArenaAllocator.State, | 39 | arena_state: std.heap.ArenaAllocator.State, |
| 40 | bin_file: *link.File, | 40 | bin_file: *link.File, |
| 41 | c_object_table: std.AutoArrayHashMapUnmanaged(*CObject, void) = .{}, | 41 | c_object_table: std.AutoArrayHashMapUnmanaged(*CObject, void) = .{}, |
| 42 | c_object_cache_digest_set: std.AutoHashMapUnmanaged(Cache.BinDigest, void) = .{}, | | |
| 43 | stage1_lock: ?Cache.Lock = null, | 42 | stage1_lock: ?Cache.Lock = null, |
| 44 | stage1_cache_manifest: *Cache.Manifest = undefined, | 43 | stage1_cache_manifest: *Cache.Manifest = undefined, |
| 45 | | 44 | |
| ... | @@ -1590,7 +1589,6 @@ pub fn destroy(self: *Compilation) void { | ... | @@ -1590,7 +1589,6 @@ pub fn destroy(self: *Compilation) void { |
| 1590 | key.destroy(gpa); | 1589 | key.destroy(gpa); |
| 1591 | } | 1590 | } |
| 1592 | self.c_object_table.deinit(gpa); | 1591 | self.c_object_table.deinit(gpa); |
| 1593 | self.c_object_cache_digest_set.deinit(gpa); | | |
| 1594 | | 1592 | |
| 1595 | for (self.failed_c_objects.values()) |value| { | 1593 | for (self.failed_c_objects.values()) |value| { |
| 1596 | value.destroy(gpa); | 1594 | value.destroy(gpa); |
| ... | @@ -1627,7 +1625,6 @@ pub fn update(self: *Compilation) !void { | ... | @@ -1627,7 +1625,6 @@ pub fn update(self: *Compilation) !void { |
| 1627 | defer tracy.end(); | 1625 | defer tracy.end(); |
| 1628 | | 1626 | |
| 1629 | self.clearMiscFailures(); | 1627 | self.clearMiscFailures(); |
| 1630 | self.c_object_cache_digest_set.clearRetainingCapacity(); | | |
| 1631 | | 1628 | |
| 1632 | // For compiling C objects, we rely on the cache hash system to avoid duplicating work. | 1629 | // For compiling C objects, we rely on the cache hash system to avoid duplicating work. |
| 1633 | // Add a Job for each C object. | 1630 | // Add a Job for each C object. |
| ... | @@ -2615,25 +2612,6 @@ fn updateCObject(comp: *Compilation, c_object: *CObject, c_obj_prog_node: *std.P | ... | @@ -2615,25 +2612,6 @@ fn updateCObject(comp: *Compilation, c_object: *CObject, c_obj_prog_node: *std.P |
| 2615 | | 2612 | |
| 2616 | try man.hashCSource(c_object.src); | 2613 | try man.hashCSource(c_object.src); |
| 2617 | | 2614 | |
| 2618 | { | | |
| 2619 | const is_collision = blk: { | | |
| 2620 | const bin_digest = man.hash.peekBin(); | | |
| 2621 | | | |
| 2622 | const lock = comp.mutex.acquire(); | | |
| 2623 | defer lock.release(); | | |
| 2624 | | | |
| 2625 | const gop = try comp.c_object_cache_digest_set.getOrPut(comp.gpa, bin_digest); | | |
| 2626 | break :blk gop.found_existing; | | |
| 2627 | }; | | |
| 2628 | if (is_collision) { | | |
| 2629 | return comp.failCObj( | | |
| 2630 | c_object, | | |
| 2631 | "the same source file was already added to the same compilation with the same flags", | | |
| 2632 | .{}, | | |
| 2633 | ); | | |
| 2634 | } | | |
| 2635 | } | | |
| 2636 | | | |
| 2637 | var arena_allocator = std.heap.ArenaAllocator.init(comp.gpa); | 2615 | var arena_allocator = std.heap.ArenaAllocator.init(comp.gpa); |
| 2638 | defer arena_allocator.deinit(); | 2616 | defer arena_allocator.deinit(); |
| 2639 | const arena = &arena_allocator.allocator; | 2617 | const arena = &arena_allocator.allocator; |