[Python-Dev] Linus on garbage collection
fuzzyman at voidspace.org.uk
Fri May 6 19:06:35 CEST 2011
On 06/05/2011 17:51, Stefan Behnel wrote:
> Mark Shannon, 06.05.2011 18:33:
>> skip at pobox.com wrote:
>>> Antoine> Since we're sharing links, here's Matt Mackall's take:
>>>> From that note:
>>> 1: You can't have meaningful destructors, because when destruction
>>> happens is undefined. And going-out-of-scope destructors are extremely
>>> useful. Python is already a rather broken in this regard, so feel free
>>> to ignore this point.
>>> Given the presence of cyclic data I don't see how reference counting or
>>> garbage collection win. Ignoring the fact that in a pure reference
>>> system you won't even consider cycles for reclmation, would both RC
>>> and GC
>>> have to punt because they can't tell which object's destructor to call
>> It doesn't matter which is called first.
> May I quote you on that one the next time my software crashes?
Arbitrarily breaking cycles *could* cause a problem if a destructor
attempts to access an already collected object. Not breaking cycles
*definitely* leaks memory and definitely doesn't call finalizers.
> It may not make a difference for the runtime, but the difference for
> user software may be "dead" or "alive".
> Python-Dev mailing list
> Python-Dev at python.org
May you do good and not evil
May you find forgiveness for yourself and forgive others
May you share freely, never taking more than you give.
-- the sqlite blessing http://www.sqlite.org/different.html
More information about the Python-Dev