diff options
author | Nico Weber <nicolasweber@gmx.de> | 2013-04-30 15:55:49 (GMT) |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2013-04-30 15:55:49 (GMT) |
commit | f70a90edc6681fef7e75c7bc7f2860d40c2490ee (patch) | |
tree | 1372a4c94e1357c28fd4013b6b1de948eafcca15 /src/deps_log.cc | |
parent | 20942b8cf86da96eb4288138fba72c2609cfd54d (diff) | |
download | Ninja-f70a90edc6681fef7e75c7bc7f2860d40c2490ee.zip Ninja-f70a90edc6681fef7e75c7bc7f2860d40c2490ee.tar.gz Ninja-f70a90edc6681fef7e75c7bc7f2860d40c2490ee.tar.bz2 |
Let DepsLog::RecordDeps() update its in-memory representation.
This is a behavior change, but it should be safe: Graph only queries the
deps log at startup, before running any command. Nothing else currently
queries the deps log.
Diffstat (limited to 'src/deps_log.cc')
-rw-r--r-- | src/deps_log.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/deps_log.cc b/src/deps_log.cc index 8d90765..fd7d107 100644 --- a/src/deps_log.cc +++ b/src/deps_log.cc @@ -106,6 +106,7 @@ bool DepsLog::RecordDeps(Node* node, TimeStamp mtime, if (!made_change) return true; + // Update on-disk representation. uint16_t size = 4 * (1 + 1 + (uint16_t)node_count); size |= 0x8000; // Deps record: set high bit. fwrite(&size, 2, 1, file_); @@ -118,6 +119,12 @@ bool DepsLog::RecordDeps(Node* node, TimeStamp mtime, fwrite(&id, 4, 1, file_); } + // Update in-memory representation. + Deps* deps = new Deps(mtime, node_count); + for (int i = 0; i < node_count; ++i) + deps->nodes[i] = nodes[i]; + UpdateDeps(node->id(), deps); + return true; } |