authorgravatar for leroycepearson@geemili.xyzLeRoyce Pearson <leroycepearson@geemili.xyz> 2020-04-30 20:00:26-06:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-05-25 13:48:43-04:00
log5a1c6a362743882ba2923570c24f77f555a39504
tree0a586ed1bf9dd632c4fa821c6eaeb5349a056dce
parentbe69e8e871d26973c644cfad5225ae9e337179c9

Set manifest's maximum size to Andrew's recommendation


1 files changed, 3 insertions(+), 2 deletions(-)

lib/std/cache_hash.zig+3-2
...@@ -15,6 +15,8 @@ const base64_decoder = fs.base64_decoder;...@@ -15,6 +15,8 @@ const base64_decoder = fs.base64_decoder;
15const BIN_DIGEST_LEN = 48;15const BIN_DIGEST_LEN = 48;
16const BASE64_DIGEST_LEN = base64.Base64Encoder.calcSize(BIN_DIGEST_LEN);16const BASE64_DIGEST_LEN = base64.Base64Encoder.calcSize(BIN_DIGEST_LEN);
1717
18const MANIFEST_FILE_SIZE_MAX = 50 * 1024 * 1024;
19
18pub const File = struct {20pub const File = struct {
19 path: ?[]const u8,21 path: ?[]const u8,
20 stat: fs.File.Stat,22 stat: fs.File.Stat,
...@@ -150,8 +152,7 @@ pub const CacheHash = struct {...@@ -150,8 +152,7 @@ pub const CacheHash = struct {
150 };152 };
151 }153 }
152154
153 // TODO: Figure out a good max value?155 const file_contents = try self.manifest_file.?.inStream().readAllAlloc(self.alloc, MANIFEST_FILE_SIZE_MAX);
154 const file_contents = try self.manifest_file.?.inStream().readAllAlloc(self.alloc, 16 * 1024);
155 defer self.alloc.free(file_contents);156 defer self.alloc.free(file_contents);
156157
157 const input_file_count = self.files.items.len;158 const input_file_count = self.files.items.len;