On 2018-12-06 14:07, Simon King wrote:
And if I understand correctly what you said in another post, it is *dynamically* determined which reference is weak and which reference is strong. When is it determined? During cyclic gc?
Yes, during GC: that's the only time where it matters. More precisely, it is determined during every tp_traverse loop.
With a "tp_traverse loop", I mean a loop of the form for obj in set_of_objects: type(obj)->tp_traverse(obj, visit, arg) where "visit" is constant during the loop (arg does not matter).
Does that mean that you change the innards of Python's cyclic gc?
No, nothing needs to be patched. It's just a clever way of implementing tp_traverse(). I am making assumptions on how GC works internally: in particular, I am assuming that it's OK to dynamically change the reference graph as long as it's consistent during every individual tp_traverse loop.
Hopefully it is explained in #26790; I'll have a look...
That's #26811 but that's work in progress. -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.