The key difference here is between circular references amongst instances 
and amongst classes. Circular references amongst instances does not work 
in the python because it creates a cycle in the object hierarchy which 
is why the C++ trick is necessary. If you're circular references are in 
the classes and you fill them with -different- instances so as not to 
create a cycle, then apparently that will work in python. That would be 
something like class A -> class B -> class A where the two instances of 
class A are different objects.

Gabe

nathan binkert wrote:
>> We do have circular references in the C++ objects but they're not
>> setup through Python. The subobjects constructor sets the back
>> pointer.  For example the Tsunami object has a pointer to each
>> Tsunami*Chip object so when the Tsunami*Chip object is constructed it
>> has a pointer to Tsunami and sets the back pointer there. At
>> Tsunami::init() all the pointers are setup. Python didn't need to
>> handle the circular references for this to work though.
>>     
> Correct, but we also allow this to happen in the python code now and
> have for quite a while.
> _______________________________________________
> m5-dev mailing list
> m5-dev@m5sim.org
> http://m5sim.org/mailman/listinfo/m5-dev
>   

_______________________________________________
m5-dev mailing list
m5-dev@m5sim.org
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to