summaryrefslogtreecommitdiff
path: root/mem/bus.hh
diff options
context:
space:
mode:
authorAli Saidi <saidi@eecs.umich.edu>2006-04-07 16:26:22 -0400
committerAli Saidi <saidi@eecs.umich.edu>2006-04-07 16:26:22 -0400
commit2609ed2a7cf736834cafcf0b07465c45dfb567e3 (patch)
treed4e32caeeb3d9df48c7913b5d211954eb6fae084 /mem/bus.hh
parent6a7108897bd7a99514b28ede31fc23a70516b205 (diff)
downloadgem5-2609ed2a7cf736834cafcf0b07465c45dfb567e3.tar.xz
a bit of bad code trampling on memory
--HG-- extra : convert_revision : c0252dce6d7fc4c35ecd9f87ac4555e704de91b7
Diffstat (limited to 'mem/bus.hh')
-rw-r--r--mem/bus.hh13
1 files changed, 5 insertions, 8 deletions
diff --git a/mem/bus.hh b/mem/bus.hh
index eff42c55a..fad44aba5 100644
--- a/mem/bus.hh
+++ b/mem/bus.hh
@@ -127,12 +127,9 @@ class Bus : public MemObject
};
- /** A count of the number of interfaces connected to this bus. */
- int num_interfaces;
-
/** An array of pointers to the peer port interfaces
connected to this bus.*/
- Port *interfaces[];
+ std::vector<Port*> interfaces;
public:
@@ -140,12 +137,12 @@ class Bus : public MemObject
virtual Port *getPort(const std::string &if_name)
{
// if_name ignored? forced to be empty?
- int id = num_interfaces++;
- interfaces[id] = new BusPort(this, id);
- return interfaces[id];
+ int id = interfaces.size();
+ interfaces.push_back(new BusPort(this, id));
+ return interfaces.back();
}
Bus(const std::string &n)
- : MemObject(n), num_interfaces(0) {}
+ : MemObject(n) {}
};