ruby: get rid of RefCnt and Allocator stuff use base/refcnt.hh
authorNathan Binkert <nate@binkert.org>
Fri, 11 Jun 2010 06:17:06 +0000 (23:17 -0700)
committerNathan Binkert <nate@binkert.org>
Fri, 11 Jun 2010 06:17:06 +0000 (23:17 -0700)
commitbc87fa30d72df7db6265be50b2c39dc218076f9f
tree9e27c5ec1bbdbee048f2e91fc450d71f47bdf88d
parentaa7888797032bab49b5f0f637c859740497423d8
ruby: get rid of RefCnt and Allocator stuff use base/refcnt.hh

This was somewhat tricky because the RefCnt API was somewhat odd.  The
biggest confusion was that the the RefCnt object's constructor that
took a TYPE& cloned the object.  I created an explicit virtual clone()
function for things that took advantage of this version of the
constructor.  I was conservative and used clone() when I was in doubt
of whether or not it was necessary.  I still think that there are
probably too many instances of clone(), but hopefully not too many.

I converted several instances of const MsgPtr & to a simple MsgPtr.
If the function wants to avoid the overhead of creating another
reference, then it should just use a regular pointer instead of a ref
counting ptr.

There were a couple of instances where refcounted objects were created
on the stack.  This seems pretty dangerous since if you ever
accidentally make a reference to that object with a ref counting
pointer, bad things are bound to happen.
22 files changed:
src/mem/gems_common/Allocator.hh [deleted file]
src/mem/gems_common/RefCnt.hh [deleted file]
src/mem/gems_common/RefCnt_tester.cc [deleted file]
src/mem/gems_common/RefCountable.hh [deleted file]
src/mem/gems_common/SConscript [deleted file]
src/mem/ruby/buffers/MessageBuffer.cc
src/mem/ruby/buffers/MessageBuffer.hh
src/mem/ruby/common/Debug.cc
src/mem/ruby/common/Debug.hh
src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc
src/mem/ruby/network/garnet/fixed-pipeline/RoutingUnit_d.cc
src/mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.cc
src/mem/ruby/network/garnet/flexible-pipeline/Router.cc
src/mem/ruby/network/simple/PerfectSwitch.cc
src/mem/ruby/network/simple/Throttle.cc
src/mem/ruby/slicc_interface/Message.hh
src/mem/ruby/slicc_interface/NetworkMessage.hh
src/mem/ruby/system/DMASequencer.cc
src/mem/ruby/system/MemoryControl.cc
src/mem/ruby/system/Sequencer.cc
src/mem/slicc/ast/EnqueueStatementAST.py
src/mem/slicc/symbols/Type.py