Tim Peters added the comment: The only way to be certain you're never going to face re-entrancy issues in the future is to call malloc() directly - and hope nobody redefines that too with some goofy macro ;-)
In the meantime, stick to PyMem_Malloc(). That's the intended way for code holding the GIL to do lowest-level memory allocation. Uses of PyMem_RawMalloc() should be extremely rare, typically only in contexts where Python internals _know_ the GIL isn't being held, and can't reasonably try to acquire the GIL. It's already being used in a few contexts where it probably shouldn't be, and each such use needlessly complicates future changes. If PyMem_Malloc() does grow re-entrancy issues in the future, deques will be the least of our problems. I'd strongly oppose it before then. It's _intended_ to be as low level as possible (it was created to begin with just to worm around cross-platform insanity when called with a 0 argument). ---------- nosy: +tim.peters _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25135> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com