This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author tim.peters
Recipients rhettinger, serhiy.storchaka, tim.peters, vstinner
Date 2015-09-25.18:51:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1443207094.69.0.554253945394.issue25135@psf.upfronthosting.co.za>
In-reply-to
Content
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).
History
Date User Action Args
2015-09-25 18:51:34tim.peterssetrecipients: + tim.peters, rhettinger, vstinner, serhiy.storchaka
2015-09-25 18:51:34tim.peterssetmessageid: <1443207094.69.0.554253945394.issue25135@psf.upfronthosting.co.za>
2015-09-25 18:51:34tim.peterslinkissue25135 messages
2015-09-25 18:51:34tim.peterscreate