| ... | ... | @@ -39,7 +39,6 @@ gpa: *Allocator, |
| 39 | 39 | arena_state: std.heap.ArenaAllocator.State, |
| 40 | 40 | bin_file: *link.File, |
| 41 | 41 | c_object_table: std.AutoArrayHashMapUnmanaged(*CObject, void) = .{}, |
| 42 | | c_object_cache_digest_set: std.AutoHashMapUnmanaged(Cache.BinDigest, void) = .{}, |
| 43 | 42 | stage1_lock: ?Cache.Lock = null, |
| 44 | 43 | stage1_cache_manifest: *Cache.Manifest = undefined, |
| 45 | 44 | |
| ... | ... | @@ -1590,7 +1589,6 @@ pub fn destroy(self: *Compilation) void { |
| 1590 | 1589 | key.destroy(gpa); |
| 1591 | 1590 | } |
| 1592 | 1591 | self.c_object_table.deinit(gpa); |
| 1593 | | self.c_object_cache_digest_set.deinit(gpa); |
| 1594 | 1592 | |
| 1595 | 1593 | for (self.failed_c_objects.values()) |value| { |
| 1596 | 1594 | value.destroy(gpa); |
| ... | ... | @@ -1627,7 +1625,6 @@ pub fn update(self: *Compilation) !void { |
| 1627 | 1625 | defer tracy.end(); |
| 1628 | 1626 | |
| 1629 | 1627 | self.clearMiscFailures(); |
| 1630 | | self.c_object_cache_digest_set.clearRetainingCapacity(); |
| 1631 | 1628 | |
| 1632 | 1629 | // For compiling C objects, we rely on the cache hash system to avoid duplicating work. |
| 1633 | 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 | 2612 | |
| 2616 | 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 | 2615 | var arena_allocator = std.heap.ArenaAllocator.init(comp.gpa); |
| 2638 | 2616 | defer arena_allocator.deinit(); |
| 2639 | 2617 | const arena = &arena_allocator.allocator; |