Pablo Galindo Salgado <pablog...@gmail.com> added the comment:

> I'm not sure what you mean here by "balanced ref count" or by "work" :) What 
> will happen anytime an immortal object gets into the GC, for any reason, is 
> that the GC will "subtract" cyclic references and see that the immortal 
> object still has a large refcount even after that adjustment, and so it will 
> keep the immortal object and any cycle it is part of alive. This behavior is 
> correct and should be fully expected; nothing breaks. It doesn't matter at 
> all to the GC that this large refcount is "fictional," and it doesn't break 
> the GC algorithm, it results only in the desired behavior of maintaining 
> immortality of immortal objects.


Yep, that is right. I think there was a race condition between my previous 
message and yours :)

I think what was confusing me in this line of reasoning is that I was not 
taking into account that the immortal bit is a very high one, making the 
refcount gigantic. I was treating it mentally like a flag without factoring the 
implications of such big reference count.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue40255>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to