bugfix: since pow() causes a bug don't use it

It's a power of two anyway, so why use it in the first place.
This commit is contained in:
Nathan Binkert
2010-03-12 15:11:09 -08:00
parent 140785d24c
commit fce7c820f4

View File

@@ -2,8 +2,6 @@
#ifndef PSEUDOLRUPOLICY_H
#define PSEUDOLRUPOLICY_H
#include <cmath>
#include "mem/ruby/system/AbstractReplacementPolicy.hh"
/**
@@ -57,7 +55,7 @@ PseudoLRUPolicy::PseudoLRUPolicy(Index num_sets, Index assoc)
m_num_levels++;
}
assert(m_num_levels < sizeof(unsigned int)*4);
num_tree_nodes = ((int)pow(2, m_num_levels))-1;
num_tree_nodes = (1 << m_num_levels) - 1;
m_trees = new uint64[m_num_sets];
for(unsigned int i=0; i< m_num_sets; i++){
m_trees[i] = 0;