Author vstinner
Recipients serhiy.storchaka, vstinner, xiang.zhang
Date 2018-10-26.10:39:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1540550365.32.0.788709270274.issue35056@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2018-10-26 10:39:25vstinnersetrecipients: + vstinner, serhiy.storchaka, xiang.zhang
2018-10-26 10:39:25vstinnersetmessageid: <1540550365.32.0.788709270274.issue35056@psf.upfronthosting.co.za>
2018-10-26 10:39:25vstinnerlinkissue35056 messages
2018-10-26 10:39:25vstinnercreate