[issue18227] Use Python memory allocators in external libraries like zlib or OpenSSL

2013-12-16 Thread STINNER Victor
STINNER Victor added the comment: I modified modules when it was possible and easy to do. More modules should be modified, but it's more tricky. If you are interested, please open new issues. -- resolution: - fixed status: open - closed ___ Python

[issue18227] Use Python memory allocators in external libraries like zlib or OpenSSL

2013-07-07 Thread Roundup Robot
Roundup Robot added the comment: New changeset a876d9d2e4fc by Victor Stinner in branch 'default': Issue #18227: Use PyMem_RawAlloc() in bz2, lzma and zlib modules http://hg.python.org/cpython/rev/a876d9d2e4fc -- nosy: +python-dev ___ Python tracker

[issue18227] Use Python memory allocators in external libraries like zlib or OpenSSL

2013-07-07 Thread Roundup Robot
Roundup Robot added the comment: New changeset 12f26c356611 by Victor Stinner in branch 'default': Issue #18227: Free function of bz2, lzma and zlib modules has no return value (void) http://hg.python.org/cpython/rev/12f26c356611 -- ___ Python

[issue18227] Use Python memory allocators in external libraries like zlib or OpenSSL

2013-07-07 Thread Roundup Robot
Roundup Robot added the comment: New changeset 7f17c67b5bf6 by Christian Heimes in branch 'default': Issue #18227: pyexpat now uses a static XML_Memory_Handling_Suite. cElementTree uses the same approach since at least Python 2.6 http://hg.python.org/cpython/rev/7f17c67b5bf6 --

[issue18227] Use Python memory allocators in external libraries like zlib or OpenSSL

2013-06-22 Thread STINNER Victor
STINNER Victor added the comment: Here is an initial attempt: set a custom allocator for bz2, lzma and zlib modules. The allocator is only replaced for an instance of a compressor or decompress, the change does not affect the library globally. PyMem_RawMalloc() is used instead of

[issue18227] Use Python memory allocators in external libraries like zlib or OpenSSL

2013-06-21 Thread STINNER Victor
STINNER Victor added the comment: It looks like CRYPTO_set_mem_functions() of OpenSSL 1.0.1e-4.fc18 does not work: CRYPTO_set_mem_functions() calls indirectly CRYPTO_malloc() which sets allow_customize = 0; and so CRYPTO_set_mem_functions() does nothing (just return 0, instead of 1). Gdb

[issue18227] Use Python memory allocators in external libraries like zlib or OpenSSL

2013-06-16 Thread Aaron Iles
Changes by Aaron Iles aaron.i...@gmail.com: -- nosy: +aliles ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18227 ___ ___ Python-bugs-list mailing

[issue18227] Use Python memory allocators in external libraries like zlib or OpenSSL

2013-06-15 Thread STINNER Victor
New submission from STINNER Victor: With the PEP 445 and the issue #3329, Python will get an API to setup custom memory allocators. To be able to configure how memory is handled in external libraries, some libraries allow to setup a custom allocator too. New functions PyMem_RawMalloc(),

[issue18227] Use Python memory allocators in external libraries like zlib or OpenSSL

2013-06-15 Thread STINNER Victor
STINNER Victor added the comment: See also the issue #18203: Replace calls to malloc() with PyMem_Malloc() or PyMem_RawMalloc(). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18227 ___

[issue18227] Use Python memory allocators in external libraries like zlib or OpenSSL

2013-06-15 Thread STINNER Victor
STINNER Victor added the comment: Uncomplete(?) list of external libraries used by Python: - libffi (_ctypes): has its own memory allocator (dlmalloc), is it used? see also issue #18178 - libmpdec (_decimal): already configured to reuse the PyMem_Malloc() family (see