New submission from STINNER Victor: 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. ---------- messages: 191076 nosy: amaury.forgeotdarc, haypo, kristjan.jonsson, ncoghlan priority: normal severity: normal status: open title: Replace calls to malloc() with PyMem_Malloc() type: enhancement versions: Python 3.4 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue18203> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com