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

Antoine Pitrou solipsis at pitrou.net
Sat Jun 15 03:04:31 CEST 2013


On Sat, 15 Jun 2013 00:44:11 +0200 (CEST)
victor.stinner <python-checkins at python.org> wrote:
> http://hg.python.org/cpython/rev/6661a8154eb3
> changeset:   84127:6661a8154eb3
> user:        Victor Stinner <victor.stinner at gmail.com>
> date:        Sat Jun 15 00:37:46 2013 +0200
> summary:
>   Issue #3329: Add new APIs to customize memory allocators
> 
> * Add a new PyMemAllocators structure
> * New functions:
> 
>   - PyMem_RawMalloc(), PyMem_RawRealloc(), PyMem_RawFree(): GIL-free memory
>     allocator functions
>   - PyMem_GetRawAllocators(), PyMem_SetRawAllocators()
>   - PyMem_GetAllocators(), PyMem_SetAllocators()
>   - PyMem_SetupDebugHooks()
>   - _PyObject_GetArenaAllocators(), _PyObject_SetArenaAllocators()

My two cents, but I would prefer if this whole changeset was reverted.
I think it adds too much complexity in the memory allocation APIs,
for a pretty specialized benefit. IMHO, we should be able to get by with
less allocation APIs (why the new _Raw APIs) and less hook-setting
functions.

Regards

Antoine.




More information about the Python-Dev mailing list