Python's garbage collection was Re: Python reliability

Paul Rubin http
Mon Oct 10 18:22:32 EDT 2005


Tom Anderson <twic at urchin.earth.li> writes:
> Has anyone looked into using a real GC for python? I realise it would
> be a lot more complexity in the interpreter itself, but it would be
> faster, more reliable, and would reduce the complexity of extensions.

The next PyPy sprint (this week I think) is going to focus partly on GC.

> Hmm. Maybe it wouldn't make extensions easier or more reliable. You'd
> still need some way of figuring out which variables in C-land held
> pointers to objects; if anything, that might be harder, unless you
> want to impose a horrendous JAI-like bondage-and-discipline interface.

I'm not sure what JAI is (do you mean JNI?) but you might look at how
Emacs Lisp does it.  You have to call a macro to protect intermediate
heap results in C functions from GC'd, so it's possible to make
errors, but it cleans up after itself and is generally less fraught
with hazards than Python's method is.



More information about the Python-list mailing list