[Python-Dev] Debug entry points for PyMalloc

Tim Peters tim.one@comcast.net
Thu, 21 Mar 2002 18:07:30 -0500


[Guido]
>>> Rather than trying to mimic this in pymalloc, isn't it easier to have
>>> a way to go back to the platform malloc?

[Tim]
>> We have one already:  turn off pymalloc.

[Martin v. Loewis]
> Notice that this is possible both at compile time and at run-time; it
> seems that you were thinking of the compile-time option, whereas Guido
> was asking for the run-time option.

After some number of calls to, e.g., PyObject_New, you can't just switch
allocators in midstream, lest the eventual attempt to free the object hand
the address off to a different allocator than was used to obtain the memory.
Or maybe I have no idea what you're trying to say?