Message191049
New version (4) of the patch:
- move the opaque pointer (now called "void *ctx", "context") as the first parameter instead of the last parameter, as done in zlib, lzma and Oracle's OCI APIs; ctx is also the first parameter of Py*_GetFunctions() and Py*_SetFunctions() instead of the last
- rename public functions:
* Py_GetAllocators() -> PyMem_GetAllocators(), PyObject_GetAllocators()
* Py_SetAllocators() -> PyMem_SetAllocators(), PyObject_SetAllocators()
* Py_GetBlockAllocators() -> PyObject_GetArenaAllocators()
* Py_SetBlockAllocators() -> PyObject_SetArenaAllocators()
- move declaration of PyObject_*() functions from pymem.h to objimpl.h
- split _PyMem big structure into smaller structures: _PyMem, _PyObject, _PyObject_Arena
- move "if (size == 0) size = 1;" from PyMem_Malloc() to _PyMem_Malloc(), so the custom allocator can decide how to implement PyMem_Malloc(0) (maybe something more efficient)
Does the new API look better? py_setallocators-4.patch is ready for a final review. If nobody complains, I'm going to commit it. |
|
Date |
User |
Action |
Args |
2013-06-12 21:51:09 | vstinner | set | recipients:
+ vstinner, barry, rhettinger, gregory.p.smith, amaury.forgeotdarc, ncoghlan, Rhamphoryncus, pitrou, kristjan.jonsson, jszakmeister, tlesher, jlaurila, neilo, pjmcnerney |
2013-06-12 21:51:09 | vstinner | set | messageid: <1371073869.6.0.0575976127124.issue3329@psf.upfronthosting.co.za> |
2013-06-12 21:51:09 | vstinner | link | issue3329 messages |
2013-06-12 21:51:09 | vstinner | create | |
|