[Python-Dev] Activating pymalloc

Tim Peters tim.one@comcast.net
Fri, 15 Mar 2002 13:52:04 -0500


[Tim]
>> I wonder whether it's actually a good idea for PyMem_New (etc) to ...

[Guido]
> Well, then you would have to provide yet another set of macros that
> don't require the GIL, for use by extensions that need to allocate
> memory while not holding the GIL.

BTW, where does it say it's OK to use PyMem_XXX when not holding the GIL?
The only exceptions I know of to "the GIL rule" are listed in the "Thread
State and the Global Interpreter Lock" section, and that doesn't mention
PyMem_XXX.  The PyMem_XXX docs don't mention it either, ditto any code
comments I've been able to find.

I guess it's an intended exception (else you wouldn't have written the
above), but I want to make sure.