This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jlaurila
Recipients jlaurila
Date 2008-07-09.19:48:50
SpamBayes Score 0.0008442137
Marked as misclassified No
Message-id <>
Currently Python always uses the C library malloc/realloc/free as the
underlying mechanism for requesting memory from the OS, but especially
on memory-limited platforms it is often desirable to be able to override
the allocator and to redirect all Python's allocations to use a special
heap. This will make it possible to free memory back to the operating
system without restarting the process, and to reduce fragmentation by
separating Python's allocations from the rest of the program.

The proposal is to make it possible to set the allocator used by the
Python interpreter by calling the following function before Py_Initialize():

void Py_SetAllocator(void* (*alloc)(size_t), void* (*realloc)(void*,
size_t), void (*free)(void*))

Direct function calls to malloc/realloc/free in obmalloc.c must be
replaced with calls through the function pointers set through this
function. By default these would of course point to the C stdlib
Date User Action Args
2008-07-09 19:48:53jlaurilasetspambayes_score: 0.000844214 -> 0.0008442137
recipients: + jlaurila
2008-07-09 19:48:53jlaurilasetspambayes_score: 0.000844214 -> 0.000844214
messageid: <>
2008-07-09 19:48:51jlaurilalinkissue3329 messages
2008-07-09 19:48:50jlaurilacreate