STINNER Victor added the comment: > This patch does not propose a simple API to reuse internal > debug hooks when replacing system (PyMem) allocators.
Ok, this is now fixed with new patch (version 5). Nick does not want a new environment variable, so I added instead a new function PyMem_SetupDebugHooks() which reinstalls hooks to detect bugs if allocator functions were replaced with PyMem_SetAllocators() or PyObject_SetAllocators(). The function does nothing is Python is not compiled in debug more or if hooks are already installed (so the function can be called twice). I also added unit tests for PyMem_SetAllocators() and PyObject_SetAllocators()! And I added "versionadded:: 3.4" to the C API documentation. ---------- Added file: http://bugs.python.org/file30575/py_setallocators-5.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue3329> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com