diff options
Diffstat (limited to 'src/mem/ruby/filters/BlockBloomFilter.cc')
-rw-r--r-- | src/mem/ruby/filters/BlockBloomFilter.cc | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/mem/ruby/filters/BlockBloomFilter.cc b/src/mem/ruby/filters/BlockBloomFilter.cc index 21d7921c6..875a0d015 100644 --- a/src/mem/ruby/filters/BlockBloomFilter.cc +++ b/src/mem/ruby/filters/BlockBloomFilter.cc @@ -26,6 +26,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include "base/intmath.hh" +#include "base/str.hh" #include "mem/gems_common/Map.hh" #include "mem/ruby/common/Address.hh" #include "mem/ruby/filters/BlockBloomFilter.hh" @@ -34,11 +36,17 @@ using namespace std; BlockBloomFilter::BlockBloomFilter(string str) { - string tail(str); - string head = string_split(tail, '_'); + string head, tail; + +#ifndef NDEBUG + bool success = +#endif + split_first(str, head, tail, '_'); + + assert(success); m_filter_size = atoi(head.c_str()); - m_filter_size_bits = log_int(m_filter_size); + m_filter_size_bits = floorLog2(m_filter_size); m_filter.setSize(m_filter_size); |