authorgravatar for leroycepearson@geemili.xyzLeRoyce Pearson <leroycepearson@geemili.xyz> 2020-04-14 22:17:55-06:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-05-25 13:48:43-04:00
logb429f4607c320118f5e0443605b29dda39521204
tree7288845af478d7399431a3c0856033c7b73d0410
parente7657f2938e9061a546c5ad726a9575ad6a8eba3

Make `addFilePost*` functions' documentation more clear


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

lib/std/cache_hash.zig+8-2
...@@ -258,7 +258,11 @@ pub const CacheHash = struct {...@@ -258,7 +258,11 @@ pub const CacheHash = struct {
258 }258 }
259259
260 /// Add a file as a dependency of process being cached, after the initial hash has been260 /// Add a file as a dependency of process being cached, after the initial hash has been
261 /// calculated. Returns the contents of the file, allocated with the given allocator.261 /// calculated. This is useful for processes that don't know the all the files that
262 /// are depended on ahead of time. For example, a source file that can import other files
263 /// will need to be recompiled if the imported file is changed.
264 ///
265 /// Returns the contents of the file, allocated with the given allocator.
262 pub fn addFilePostFetch(self: *@This(), otherAlloc: *mem.Allocator, file_path: []const u8) ![]u8 {266 pub fn addFilePostFetch(self: *@This(), otherAlloc: *mem.Allocator, file_path: []const u8) ![]u8 {
263 debug.assert(self.manifest_file != null);267 debug.assert(self.manifest_file != null);
264268
...@@ -269,7 +273,9 @@ pub const CacheHash = struct {...@@ -269,7 +273,9 @@ pub const CacheHash = struct {
269 }273 }
270274
271 /// Add a file as a dependency of process being cached, after the initial hash has been275 /// Add a file as a dependency of process being cached, after the initial hash has been
272 /// calculated.276 /// calculated. This is useful for processes that don't know the all the files that
277 /// are depended on ahead of time. For example, a source file that can import other files
278 /// will need to be recompiled if the imported file is changed.
273 pub fn addFilePost(self: *@This(), file_path: []const u8) !void {279 pub fn addFilePost(self: *@This(), file_path: []const u8) !void {
274 const contents = try self.addFilePostFetch(self.alloc, file_path);280 const contents = try self.addFilePostFetch(self.alloc, file_path);
275 self.alloc.free(contents);281 self.alloc.free(contents);