> No, my idea was not to share the same RefCountingPtr. I was trying to share > the pointer to an object reference to which are being counted. If you take a > look at the patches that I have posted on the m5 review board, I am trying > to use the same RubyRequest object in multiple places. The class RubyRequest > is reference counted and I was trying to make sure that the multiple > pointers to same object of this class are handled correctly.
That's exactly what RefCountingPtr is for. There is too much in that patch for me to really understand what you're doing and what your problem is. Are you comfortable that you know what is going on and how things work? Bugs in this kind of code lead to memory leaks and random segmentation faults, so I'd like to make sure you know what is going on. If you follow this simple rule of thumb you should be OK: If you're using a class Foo that derives from RefCounted, never use "Foo *", rather only ever use RefCountingPtr<Foo> (which you should probably typedef to FooPtr), and use it just as you would a Foo *. Nate _______________________________________________ m5-dev mailing list m5-dev@m5sim.org http://m5sim.org/mailman/listinfo/m5-dev