[Python-Dev] cpython: Issue #3329: Add new APIs to customize memory allocators

Christian Heimes christian at python.org
Sat Jun 15 17:49:41 CEST 2013

Am 15.06.2013 14:57, schrieb Victor Stinner:
> Le 15 juin 2013 03:54, "Victor Stinner" <victor.stinner at gmail.com
> <javascript:_e({}, 'cvml', 'victor.stinner at gmail.com');>> a écrit :
>> Ok, I reverted my commit.
>> I will work on a PEP to explain all these new functions and their use
> cases.
> I created the PEP 445 to reserve the number. It is ready for a review
> but already containssome explanation of the new API.


How about you compare your approach with some other libraries, too?
Other projects have dealt with similar issues in the past, too. libxml2
has an extensive API for memory management and debugging.

I have assembled a list of APIs for you:

OpenSSL has CRYPTO_set_mem_functions() to set memory management
functions globally

expat has a per-instance memory handler:

libtiff has three global hooks _TIFFmalloc(), _TIFFrealloc() and
_TIFFfree() that are used instead of malloc() in its core.

libxml2 has http://xmlsoft.org/html/libxml-xmlmemory.html


More information about the Python-Dev mailing list