diff options
Diffstat (limited to 'ninja/src/deps_log.h')
-rw-r--r-- | ninja/src/deps_log.h | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/ninja/src/deps_log.h b/ninja/src/deps_log.h index de0fe639d14..cec0257ceff 100644 --- a/ninja/src/deps_log.h +++ b/ninja/src/deps_log.h @@ -50,9 +50,12 @@ struct State; /// A dependency list maps an output id to a list of input ids. /// /// Concretely, a record is: -/// two bytes record length, high bit indicates record type -/// (implies max record length 32k) -/// path records contain just the string name of the path +/// four bytes record length, high bit indicates record type +/// (but max record sizes are capped at 512kB) +/// path records contain the string name of the path, followed by up to 3 +/// padding bytes to align on 4 byte boundaries, followed by the +/// one's complement of the expected index of the record (to detect +/// concurrent writes of multiple ninja processes to the log). /// dependency records are an array of 4-byte integers /// [output path id, output path mtime, input path id, input path id...] /// (The mtime is compared against the on-disk output path mtime @@ -85,6 +88,14 @@ struct DepsLog { /// Rewrite the known log entries, throwing away old data. bool Recompact(const string& path, string* err); + /// Returns if the deps entry for a node is still reachable from the manifest. + /// + /// The deps log can contain deps entries for files that were built in the + /// past but are no longer part of the manifest. This function returns if + /// this is the case for a given node. This function is slow, don't call + /// it from code that runs on every build. + bool IsDepsEntryLiveFor(Node* node); + /// Used for tests. const vector<Node*>& nodes() const { return nodes_; } const vector<Deps*>& deps() const { return deps_; } |