[Patches] Re: Final request for GC patch
Neil Schemenauer
nascheme@enme.ucalgary.ca
Wed, 10 May 2000 07:24:08 -0600
On Wed, May 10, 2000 at 02:45:54PM +0200, Vladimir Marangozov wrote:
> Neil Schemenauer wrote:
> > Object alloction has been changed from macros to functions for
> > some important objects (list, tuple, dict). This will make
> > Python go slower even with GC disabled. We will have to profile
> > things and find out what should be inlined. For now I wanted the
> > patch to be easy to understand.
>
> What is the rationale behind this change?
Look at _PyObject_New. In order to link GC objects together
extra memory must be allocated for objects that set
Py_TPFLAGS_HAVE_GCINFO. Although this check does not have to be
done a run time I didn't want to clutter my patch with lots of
ifdefs.
Extension modules that set HAVE_GCINFO should always use the
object functions for memory managment. That way they will work
with both GC enabled and GC disabled Python.
Neil