STINNER Victor <vstin...@redhat.com> added the comment:

It seems like the easiest thing to do thta would directly benefit (to 
tracemalloc users) is to continue the implementation of bpo-18227:

* _sqlite: call sqlite3_config(SQLITE_CONFIG_MALLOC, pMem) to use 
PyMem_RawMalloc()
* _ssl: try again CRYPTO_set_mem_functions()

Python modules already using Python memory allocators:

* zlib: "zst.zalloc = PyZlib_Malloc" which calls PyMem_RawMalloc
* _decimal: mpd_mallocfunc = PyMem_Malloc
* _lzma: "self->alloc.alloc = PyLzma_Malloc" which calls PyMem_RawMalloc
* pyexpat: XML_ParserCreate_MM(encoding, &ExpatMemoryHandler,...) with 
ExpatMemoryHandler = {PyObject_Malloc, PyObject_Realloc, PyObject_Free}
* _bz2: "bzalloc = BZ2_Malloc" which calls PyMem_RawMalloc()

Using Python memory allocators gives access to Python builtin "memory 
debugger", even in release mode using PYTHONMALLOC=debug or -X dev.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue35056>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to