summaryrefslogtreecommitdiff
path: root/base
diff options
context:
space:
mode:
authorSteve Reinhardt <stever@eecs.umich.edu>2006-02-08 10:40:43 -0500
committerSteve Reinhardt <stever@eecs.umich.edu>2006-02-08 10:40:43 -0500
commit524da7cd20dae5416cd0962a9b9bd49dcf92ee51 (patch)
tree3cfa85608894f0ea1d33ee899a011484492c14b4 /base
parentad1e46203b2355af86d183c2d89a39a3ee29c72b (diff)
downloadgem5-524da7cd20dae5416cd0962a9b9bd49dcf92ee51.tar.xz
Replace ad-hoc or locally defined power-of-2 tests
with isPowerOf2() from intmath.hh. base/sched_list.hh: Use isPowerOf2() from intmath.hh. --HG-- extra : convert_revision : 7b2409531d8ed194aa7e1cfcd1ecb8460c797a16
Diffstat (limited to 'base')
-rw-r--r--base/sched_list.hh4
1 files changed, 3 insertions, 1 deletions
diff --git a/base/sched_list.hh b/base/sched_list.hh
index 0e2f3ddcb..f794e3514 100644
--- a/base/sched_list.hh
+++ b/base/sched_list.hh
@@ -30,8 +30,10 @@
#define SCHED_LIST_HH
#include <list>
+#include "base/intmath.hh"
#include "base/misc.hh"
+
// Any types you use this class for must be covered here...
namespace {
void ClearEntry(int &i) { i = 0; };
@@ -80,7 +82,7 @@ SchedList<T>::SchedList(unsigned _size)
size = _size;
// size must be a power of two
- if (size & (size-1)) {
+ if (!isPowerOf2(size)) {
panic("SchedList: size must be a power of two");
}