diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2014-06-02 19:57:10 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2014-06-02 19:57:10 (GMT) |
commit | d8f0d922d53a8f7bb64c1fda26be386bd2e3d958 (patch) | |
tree | 66af4790c65423eb30cf83fbb35c06a3192bc55e /Objects | |
parent | aa0e7afa438d7586353a3338fd350449714e117a (diff) | |
download | cpython-d8f0d922d53a8f7bb64c1fda26be386bd2e3d958.zip cpython-d8f0d922d53a8f7bb64c1fda26be386bd2e3d958.tar.gz cpython-d8f0d922d53a8f7bb64c1fda26be386bd2e3d958.tar.bz2 |
Issue #21233: Rename the C structure "PyMemAllocator" to "PyMemAllocatorEx" to
make sure that the code using it will be adapted for the new "calloc" field
(instead of crashing).
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/obmalloc.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Objects/obmalloc.c b/Objects/obmalloc.c index af2bab0..2036e37 100644 --- a/Objects/obmalloc.c +++ b/Objects/obmalloc.c @@ -151,7 +151,7 @@ _PyObject_ArenaFree(void *ctx, void *ptr, size_t size) typedef struct { /* We tag each block with an API ID in order to tag API violations */ char api_id; - PyMemAllocator alloc; + PyMemAllocatorEx alloc; } debug_alloc_api_t; static struct { debug_alloc_api_t raw; @@ -166,7 +166,7 @@ static struct { #define PYDBG_FUNCS _PyMem_DebugMalloc, _PyMem_DebugCalloc, _PyMem_DebugRealloc, _PyMem_DebugFree #endif -static PyMemAllocator _PyMem_Raw = { +static PyMemAllocatorEx _PyMem_Raw = { #ifdef PYMALLOC_DEBUG &_PyMem_Debug.raw, PYDBG_FUNCS #else @@ -174,7 +174,7 @@ static PyMemAllocator _PyMem_Raw = { #endif }; -static PyMemAllocator _PyMem = { +static PyMemAllocatorEx _PyMem = { #ifdef PYMALLOC_DEBUG &_PyMem_Debug.mem, PYDBG_FUNCS #else @@ -182,7 +182,7 @@ static PyMemAllocator _PyMem = { #endif }; -static PyMemAllocator _PyObject = { +static PyMemAllocatorEx _PyObject = { #ifdef PYMALLOC_DEBUG &_PyMem_Debug.obj, PYDBG_FUNCS #else @@ -209,7 +209,7 @@ void PyMem_SetupDebugHooks(void) { #ifdef PYMALLOC_DEBUG - PyMemAllocator alloc; + PyMemAllocatorEx alloc; alloc.malloc = _PyMem_DebugMalloc; alloc.calloc = _PyMem_DebugCalloc; @@ -237,7 +237,7 @@ PyMem_SetupDebugHooks(void) } void -PyMem_GetAllocator(PyMemAllocatorDomain domain, PyMemAllocator *allocator) +PyMem_GetAllocator(PyMemAllocatorDomain domain, PyMemAllocatorEx *allocator) { switch(domain) { @@ -255,7 +255,7 @@ PyMem_GetAllocator(PyMemAllocatorDomain domain, PyMemAllocator *allocator) } void -PyMem_SetAllocator(PyMemAllocatorDomain domain, PyMemAllocator *allocator) +PyMem_SetAllocator(PyMemAllocatorDomain domain, PyMemAllocatorEx *allocator) { switch(domain) { |