diff options
author | Steve Reinhardt <stever@gmail.com> | 2008-06-28 13:19:38 -0400 |
---|---|---|
committer | Steve Reinhardt <stever@gmail.com> | 2008-06-28 13:19:38 -0400 |
commit | caaac16803db6eaf3ee20b5d062ec2211fe6584d (patch) | |
tree | d3664f74378429cc389c6e166aebaca7fbcd6963 /src/mem/port.hh | |
parent | 6b45238316052f458ba9ebc9d24a91cfa9e41cf1 (diff) | |
download | gem5-caaac16803db6eaf3ee20b5d062ec2211fe6584d.tar.xz |
Backed out changeset 94a7bb476fca: caused memory leak.
Diffstat (limited to 'src/mem/port.hh')
-rw-r--r-- | src/mem/port.hh | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/mem/port.hh b/src/mem/port.hh index 4e0d91e75..15fda2164 100644 --- a/src/mem/port.hh +++ b/src/mem/port.hh @@ -87,14 +87,17 @@ class Port public: + Port(); + /** * Constructor. * * @param _name Port name for DPRINTF output. Should include name * of memory system object to which the port belongs. * @param _owner Pointer to the MemObject that owns this port. + * Will not necessarily be set. */ - Port(const std::string &_name, MemObject *_owner, Port *_peer = NULL); + Port(const std::string &_name, MemObject *_owner = NULL); /** Return port name (for DPRINTF). */ const std::string &name() const { return portName; } @@ -108,18 +111,24 @@ class Port RangeChange }; + void setName(const std::string &name) + { portName = name; } + /** Function to set the pointer for the peer port. */ virtual void setPeer(Port *port); /** Function to get the pointer to the peer port. */ Port *getPeer() { return peer; } + /** Function to set the owner of this port. */ + void setOwner(MemObject *_owner) { owner = _owner; } + /** Function to return the owner of this port. */ MemObject *getOwner() { return owner; } - /** Notify my peer port that I'm disconnecting (by calling its - * disconnect() method) so it can clean up. */ - void disconnectFromPeer(); + /** Inform the peer port to delete itself and notify it's owner about it's + * demise. */ + void removeConn(); virtual bool isDefaultPort() const { return false; } @@ -245,11 +254,6 @@ class Port /** Internal helper function for read/writeBlob(). */ void blobHelper(Addr addr, uint8_t *p, int size, MemCmd cmd); - - /** Receive notification that my peer is disconnecting and clean - * up (potentially deleting myself in the process). Should be - * called only from peer's disconnectFromPeer(). */ - void disconnect(); }; /** A simple functional port that is only meant for one way communication to |