[Python-Dev] Activating pymalloc

Tim Peters tim.one@comcast.net
Fri, 15 Mar 2002 05:35:16 -0500


[Michael Hudson]
> I think one of the reasons lots of modules break is that back in the
> 1.5.2 days, PyObject_Del didn't exist, and you were expected to use
> PyMem_Del.  This now breaks.

You mean this breaks if pymalloc is enabled, right?  Else they're just more
ways to spell "free()".

I wonder whether it's actually a good idea for PyMem_New (etc) to keep on
calling malloc/free even when pymalloc is enabled.  Anyone think they know a
reason (other than theoretical purity <wink>) for why pymalloc only targets
the PyObject family?  If Michael is right, the current distinction is indeed
guaranteed to break just about every extension written for 1.5.2.  It's also
plain irritating that if you have, e.g., a gazillion tiny lists, only the
list headers will enjoy pymalloc's speed & memory savings (the guts still
get allocated via PyMem_XXX).