Message191076
The issue #3329 proposes an API to replace memory allocator functions. But Python calls directly malloc(), realloc() and free() in some functions, so custom allocators would not be used there.
Examples of functions calling malloc/realloc/free directly: _PySequence_BytesToCharpArray(), block_new() (of pyarena.c), find_key() (of thread.c), PyInterpreterState_New(), win32_wchdir(), posix_getcwd(), Py_Main(), etc.
We have to be careful with the GIL: PyMem_*() functions can only be called when holding the GIL. |
|
Date |
User |
Action |
Args |
2013-06-13 10:52:39 | vstinner | set | recipients:
+ vstinner, amaury.forgeotdarc, ncoghlan, kristjan.jonsson |
2013-06-13 10:52:39 | vstinner | set | messageid: <1371120759.62.0.420345272246.issue18203@psf.upfronthosting.co.za> |
2013-06-13 10:52:39 | vstinner | link | issue18203 messages |
2013-06-13 10:52:39 | vstinner | create | |
|