don't use (*activeThreads).begin(), use activeThreads->blah().

Also don't call (*activeThreads).end() over and over.  Just
call activeThreads->end() once and save the result.
Make sure we always check that there are elements in the list
before we grab the first one.

--HG--
extra : convert_revision : d769d8ed52da99532d57a9bbc93e92ddf22b7e58
This commit is contained in:
Nathan Binkert
2006-12-20 22:20:11 -08:00
parent 4b3538b609
commit 9aecfb3e3b
10 changed files with 226 additions and 154 deletions

View File

@@ -426,16 +426,18 @@ void
InstructionQueue<Impl>::resetEntries()
{
if (iqPolicy != Dynamic || numThreads > 1) {
int active_threads = (*activeThreads).size();
int active_threads = activeThreads->size();
std::list<unsigned>::iterator threads = (*activeThreads).begin();
std::list<unsigned>::iterator list_end = (*activeThreads).end();
std::list<unsigned>::iterator threads = activeThreads->begin();
std::list<unsigned>::iterator end = activeThreads->end();
while (threads != end) {
unsigned tid = *threads++;
while (threads != list_end) {
if (iqPolicy == Partitioned) {
maxEntries[*threads++] = numEntries / active_threads;
maxEntries[tid] = numEntries / active_threads;
} else if(iqPolicy == Threshold && active_threads == 1) {
maxEntries[*threads++] = numEntries;
maxEntries[tid] = numEntries;
}
}
}