[Patches] Garbage collection patches for Python
Sat, 5 Feb 2000 15:00:59 +0100 (CET)
Some time ago, you (Toby Kelsey, 'xr' and Neil Schemenauer) have
submitted a patch for adding GC behavior to Python, that Guido was
kind enough to share with some Python developers.
Needless to say, on one hand, adding GC would be a radical core change
of the interpreter and on the other hand, the interest in this topic
has resulted in many useful discussion on c.l.py, as well as in
experiments targetting a suitable implementation of the ideas that have
beed proposed (in particular, the ones reflected by your submissions).
I doubt that we've reached concensus on the subject so far, despite
the experience that has been gained from past experiments.
Therefore, I presume that incorporating any kind of GC implementation
in the standard distribution, for now, is out of question (at least,
not for the upcoming 1.6 release).
However, as you may have noticed, there's one thing that needs to be
done for any "third party" mem manager (including GC): replace the
calls to malloc & friends in the core distribution by PyMem_MALLOC &
friends (macros, defined in mymalloc.h).
Thus, all malloc/free calls could be further redirected to a specific
allocator/gc interface. I think that this is a pre-condition for
any future work on mem management for Python, which can certainly be
done for 1.6.
Therefore, I suggest that we prepare a patch and sumbit it to the
newly created email@example.com mailing list.
The patch would introduce the PyMem_MALLOC interface into the core, thus
decoupling it from the standard libc malloc interface. For now, I think
the PyMem_* macros in mymalloc.h should default to the libc malloc family.
Neil Schemenauer has already submitted such a patch, but since his
submission, the rules for submitting contributions have changed -- they
should be accompanied by a short legal disclaimer.
Neil, could you please resubmit your 1st GC patch with the disclaimer,
so that we can focus on this 1st step, test the patch and fold it into
PS: You guys should talk to each other and speak up (once again)!
Each of you have had a long way towards implementing GC for Python.
For info, this msg is cc'd firstname.lastname@example.org and Guido.
Vladimir MARANGOZOV | Vladimir.Marangozov@inrialpes.fr
http://sirac.inrialpes.fr/~marangoz | tel:(+33-4)76615277 fax:76615252