diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2021-06-29 17:29:59 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-06-29 17:29:59 -0400 |
| commit | 37fbf5b0d3b0be131903e4895ee3703393b32d8f (patch) | |
| tree | d646900dc75b5863b776d117dd43e6c8005130dc /src/Compilation.zig | |
| parent | 2c385e58f96ea080bd6c732de422f84c6c38c2a2 (diff) | |
| parent | e32530b6a31432e43cc4d4d793796007423f2edb (diff) | |
| download | zig-37fbf5b0d3b0be131903e4895ee3703393b32d8f.tar.gz zig-37fbf5b0d3b0be131903e4895ee3703393b32d8f.zip | |
Merge pull request #9258 from ziglang/shared-cache-locking
Shared Cache Locking
Diffstat (limited to 'src/Compilation.zig')
| -rw-r--r-- | src/Compilation.zig | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig index f202034242..10b2a9af11 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -39,7 +39,6 @@ gpa: *Allocator, arena_state: std.heap.ArenaAllocator.State, bin_file: *link.File, c_object_table: std.AutoArrayHashMapUnmanaged(*CObject, void) = .{}, -c_object_cache_digest_set: std.AutoHashMapUnmanaged(Cache.BinDigest, void) = .{}, stage1_lock: ?Cache.Lock = null, stage1_cache_manifest: *Cache.Manifest = undefined, @@ -1590,7 +1589,6 @@ pub fn destroy(self: *Compilation) void { key.destroy(gpa); } self.c_object_table.deinit(gpa); - self.c_object_cache_digest_set.deinit(gpa); for (self.failed_c_objects.values()) |value| { value.destroy(gpa); @@ -1627,7 +1625,6 @@ pub fn update(self: *Compilation) !void { defer tracy.end(); self.clearMiscFailures(); - self.c_object_cache_digest_set.clearRetainingCapacity(); // For compiling C objects, we rely on the cache hash system to avoid duplicating work. // Add a Job for each C object. @@ -2615,25 +2612,6 @@ fn updateCObject(comp: *Compilation, c_object: *CObject, c_obj_prog_node: *std.P try man.hashCSource(c_object.src); - { - const is_collision = blk: { - const bin_digest = man.hash.peekBin(); - - const lock = comp.mutex.acquire(); - defer lock.release(); - - const gop = try comp.c_object_cache_digest_set.getOrPut(comp.gpa, bin_digest); - break :blk gop.found_existing; - }; - if (is_collision) { - return comp.failCObj( - c_object, - "the same source file was already added to the same compilation with the same flags", - .{}, - ); - } - } - var arena_allocator = std.heap.ArenaAllocator.init(comp.gpa); defer arena_allocator.deinit(); const arena = &arena_allocator.allocator; |
