]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Improve comments related to save_timestamp
authorJoel Rosdahl <joel@rosdahl.net>
Mon, 2 Dec 2019 20:58:56 +0000 (21:58 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Mon, 2 Dec 2019 20:58:56 +0000 (21:58 +0100)
src/ccache.c
src/manifest.c

index a8da341902a4a50b0c1920b12e3e63951e56d277..f06312dd9bcc42a46a14670f9e01c5d7e32123e0 100644 (file)
@@ -1386,6 +1386,8 @@ update_manifest_file(void)
                old_size = file_size(&st);
        }
 
+       // See comment in get_file_hash_index for why saving of timestamps is forced
+       // for precompiled headers.
        bool save_timestamp =
                (conf->sloppiness & SLOPPY_FILE_STAT_MATCHES)
                || output_is_precompiled_header;
index 9f46e66fc7cb182c7e026a48fb32aa482a31f5f0..fcc528776722c4133ed1e4c778706f841bea9b04 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2009-2018 Joel Rosdahl
+// Copyright (C) 2009-2019 Joel Rosdahl
 //
 // This program is free software; you can redistribute it and/or modify it
 // under the terms of the GNU General Public License as published by the Free
@@ -507,11 +507,10 @@ get_file_hash_index(struct manifest *mf,
        //
        // st->ctime may be 0, so we have to check time_of_compilation against
        // MAX(mtime, ctime).
-
-       // ccache only reads mtime/ctime if sloppy_file_stat_match is setted,
-       // so mtimes/ctimes could store as a dummy value (-1) in other scenarios.
-       // This will effectively control the total number of file infos in
-       // certain scenarios, such as CI.
+       //
+       // ccache only reads mtime/ctime if file_stat_match sloppiness is enabled, so
+       // mtimes/ctimes are stored as a dummy value (-1) if not enabled. This reduces
+       // the number of file_info entries for the common case.
 
        struct stat file_stat;
        if (save_timestamp && stat(path, &file_stat) != -1