diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2013-06-14 22:37:46 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2013-06-14 22:37:46 (GMT) |
commit | 4d7056258b07df7cbb1b9b44e7a1a9bad04f7454 (patch) | |
tree | f5b3d2b16be7b8d16dd234ac59c722d0ca24e0b4 /Objects/object.c | |
parent | 8c18da20f979cf428414a038bfaee46283e12fa2 (diff) | |
download | cpython-4d7056258b07df7cbb1b9b44e7a1a9bad04f7454.zip cpython-4d7056258b07df7cbb1b9b44e7a1a9bad04f7454.tar.gz cpython-4d7056258b07df7cbb1b9b44e7a1a9bad04f7454.tar.bz2 |
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()
* Add unit test for PyMem_Malloc(0) and PyObject_Malloc(0)
* Add unit test for new get/set allocators functions
* PyObject_Malloc() now falls back on PyMem_Malloc() instead of malloc() if
size is bigger than SMALL_REQUEST_THRESHOLD, and PyObject_Realloc() falls
back on PyMem_Realloc() instead of realloc()
* PyMem_Malloc() and PyMem_Realloc() now always call malloc() and realloc(),
instead of calling PyObject_Malloc() and PyObject_Realloc() in debug mode
Diffstat (limited to 'Objects/object.c')
-rw-r--r-- | Objects/object.c | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/Objects/object.c b/Objects/object.c index 79f1c8a..d382a3c 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -1859,26 +1859,6 @@ PyTypeObject *_PyCapsule_hack = &PyCapsule_Type; Py_ssize_t (*_Py_abstract_hack)(PyObject *) = PyObject_Size; -/* Python's malloc wrappers (see pymem.h) */ - -void * -PyMem_Malloc(size_t nbytes) -{ - return PyMem_MALLOC(nbytes); -} - -void * -PyMem_Realloc(void *p, size_t nbytes) -{ - return PyMem_REALLOC(p, nbytes); -} - -void -PyMem_Free(void *p) -{ - PyMem_FREE(p); -} - void _PyObject_DebugTypeStats(FILE *out) { |