diff options
author | Shinichiro Hamaji <shinichiro.hamaji@gmail.com> | 2015-06-27 16:34:48 +0900 |
---|---|---|
committer | Shinichiro Hamaji <shinichiro.hamaji@gmail.com> | 2015-06-29 12:26:47 +0900 |
commit | e36dd56bebb7d364d9e2596458ff332d0a9a3411 (patch) | |
tree | bc22c0d87c190cbb942e38ec1e727e0aee31ae92 /dep.cc | |
parent | 4d77b840fc3df39ad7f7a97f23e520255e05c794 (diff) | |
download | kati-e36dd56bebb7d364d9e2596458ff332d0a9a3411.tar.gz |
[C++] Reduce memory usage of DepBuilder
Diffstat (limited to 'dep.cc')
-rw-r--r-- | dep.cc | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -183,6 +183,10 @@ class DepBuilder { void PopulateExplicitRule(shared_ptr<Rule> rule) { for (StringPiece output : rule->outputs) { const bool is_suffix_rule = PopulateSuffixRule(rule, output); + + rule = make_shared<Rule>(*rule); + rule->outputs.clear(); + rule->outputs.push_back(output); auto p = rules_.insert(make_pair(output, rule)); if (p.second) { if (!first_rule_ && output.get(0) != '.') { |