Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig standard library. Public Function

unhit

Public Function
std.Build.Cache.Manifest.unhit
pub fn unhit(self: *Manifest, bin_digest: BinDigest, input_file_count: usize) void

Reset self.hash.hasher to the state it should be in after hit returns false. The hasher contains the original input digest, and all original input file digests (i.e. not including post files). Assumes that bin_digest is populated for all files up to input_file_count. As such, this is not necessarily safe to call within hit.

Params

File

Build/Cache.zig:831
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
    pub fn unhit(self: *Manifest, bin_digest: BinDigest, input_file_count: usize) void {
        // Reset the hash.
        self.hash.hasher = hasher_init;
        self.hash.hasher.update(&bin_digest);

        // Remove files not in the initial hash.
        while (self.files.count() != input_file_count) {
            var file = self.files.pop().?;
            file.key.deinit(self.cache.gpa);
        }

        for (self.files.keys()) |file| {
            self.hash.hasher.update(&file.bin_digest);
        }
    }