Message251595
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). |
|
Date |
User |
Action |
Args |
2015-09-25 18:51:34 | tim.peters | set | recipients:
+ tim.peters, rhettinger, vstinner, serhiy.storchaka |
2015-09-25 18:51:34 | tim.peters | set | messageid: <1443207094.69.0.554253945394.issue25135@psf.upfronthosting.co.za> |
2015-09-25 18:51:34 | tim.peters | link | issue25135 messages |
2015-09-25 18:51:34 | tim.peters | create | |
|