DoxigAlpha

populateFileSystemInputs

Function parameters

Parameters

#
man:*Manifest
buf:*std.ArrayListUnmanaged(u8)

Type definitions in this namespace

Types

#

Functions in this namespace

Functions

#
obtain
Be sure to call `Manifest.deinit` after successful initialization.
readSmallFile
On operating systems that support symlinks, does a readlink.
writeSmallFile
On operating systems that support symlinks, does a symlink.

This is 128 bits - Even with 2^54 cache entries, the probably of a collision would be under 10^-6

Values

#
bin_digest_len
This is 128 bits - Even with 2^54 cache entries, the probably of a collision would be under 10^-6
hex_digest_len
= bin_digest_len * 2
hasher_init
Initial state with random bytes, that can be copied.

Source

Implementation

#
pub fn populateFileSystemInputs(man: *Manifest, buf: *std.ArrayListUnmanaged(u8)) Allocator.Error!void {
    assert(@typeInfo(std.zig.Server.Message.PathPrefix).@"enum".fields.len == man.cache.prefixes_len);
    buf.clearRetainingCapacity();
    const gpa = man.cache.gpa;
    const files = man.files.keys();
    if (files.len > 0) {
        for (files) |file| {
            try buf.ensureUnusedCapacity(gpa, file.prefixed_path.sub_path.len + 2);
            buf.appendAssumeCapacity(file.prefixed_path.prefix + 1);
            buf.appendSliceAssumeCapacity(file.prefixed_path.sub_path);
            buf.appendAssumeCapacity(0);
        }
        // The null byte is a separator, not a terminator.
        buf.items.len -= 1;
    }
}