diff options
author | Robert Iannucci <robbie@rail.com> | 2012-11-09 20:07:12 (GMT) |
---|---|---|
committer | Robert A Iannucci Jr <iannucci@chromium.org> | 2012-11-09 20:07:12 (GMT) |
commit | a5bf183fd9ae7745effbce5dee1e76432c865d5a (patch) | |
tree | 910afe616b5043fc23cad216606942ed947f171a /src/state.cc | |
parent | 09515ebc7fbf0aa9b8d037f6c43a2e95b2899f4a (diff) | |
download | Ninja-a5bf183fd9ae7745effbce5dee1e76432c865d5a.zip Ninja-a5bf183fd9ae7745effbce5dee1e76432c865d5a.tar.gz Ninja-a5bf183fd9ae7745effbce5dee1e76432c865d5a.tar.bz2 |
Dump pools with State
Diffstat (limited to 'src/state.cc')
-rw-r--r-- | src/state.cc | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/state.cc b/src/state.cc index b34b938..b0da350 100644 --- a/src/state.cc +++ b/src/state.cc @@ -35,7 +35,7 @@ void Pool::EdgeFinished(const Edge& edge) { void Pool::DelayEdge(Edge* edge) { assert(depth_ != 0); - delayed_.push(edge); + delayed_.push_back(edge); } void Pool::RetrieveReadyEdges(set<Edge*>* ready_queue) { @@ -43,12 +43,22 @@ void Pool::RetrieveReadyEdges(set<Edge*>* ready_queue) { Edge* edge = delayed_.front(); if(current_use_ + edge->weight() > depth_) break; - delayed_.pop(); + delayed_.pop_front(); ready_queue->insert(edge); EdgeScheduled(*edge); } } +void Pool::Dump() const { + printf("%s (%d/%d) ->\n", name_.c_str(), current_use_, depth_); + for (deque<Edge*>::const_iterator it = delayed_.begin(); + it != delayed_.end(); ++it) + { + printf("\t"); + (*it)->Dump(); + } +} + Pool State::kDefaultPool("", 0); const Rule State::kPhonyRule("phony"); @@ -188,4 +198,12 @@ void State::Dump() { node->status_known() ? (node->dirty() ? "dirty" : "clean") : "unknown"); } + if(!pools_.empty()) { + printf("resource_pools:\n"); + for (map<string, Pool*>::const_iterator it = pools_.begin(); + it != pools_.end(); ++it) + { + it->second->Dump(); + } + } } |