diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2016-04-22 18:52:22 +0200 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2016-04-22 18:52:22 +0200 |
commit | 2995a2b502495142c84809833d2251c57b29b779 (patch) | |
tree | d495591409f88be6dd4e29adeb12b45af5cfdee7 /Objects | |
parent | c3fcba4b1a00efdfd36c4482081d8d389632a2e8 (diff) | |
download | cpython-2995a2b502495142c84809833d2251c57b29b779.tar.gz |
Issue #26249: Try test_capi on Windows
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/obmalloc.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/Objects/obmalloc.c b/Objects/obmalloc.c index d305b1d75d..3f95133a74 100644 --- a/Objects/obmalloc.c +++ b/Objects/obmalloc.c @@ -166,7 +166,7 @@ _PyObject_ArenaFree(void *ctx, void *ptr, size_t size) #else # define PYOBJ_FUNCS PYRAW_FUNCS #endif -#define PYMEM_FUNCS PYRAW_FUNCS +#define PYMEM_FUNCS PYOBJ_FUNCS typedef struct { /* We tag each block with an API ID in order to tag API violations */ @@ -198,9 +198,9 @@ static PyMemAllocatorEx _PyMem_Raw = { static PyMemAllocatorEx _PyMem = { #ifdef Py_DEBUG - &_PyMem_Debug.obj, PYDBG_FUNCS + &_PyMem_Debug.mem, PYDBG_FUNCS #else - NULL, PYOBJ_FUNCS + NULL, PYMEM_FUNCS #endif }; @@ -252,11 +252,12 @@ _PyMem_SetupAllocators(const char *opt) else if (strcmp(opt, "pymalloc") == 0 || strcmp(opt, "pymalloc_debug") == 0) { - PyMemAllocatorEx mem_alloc = {NULL, PYRAW_FUNCS}; + PyMemAllocatorEx raw_alloc = {NULL, PYRAW_FUNCS}; + PyMemAllocatorEx mem_alloc = {NULL, PYMEM_FUNCS}; PyMemAllocatorEx obj_alloc = {NULL, PYOBJ_FUNCS}; - PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &mem_alloc); - PyMem_SetAllocator(PYMEM_DOMAIN_MEM, &obj_alloc); + PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &raw_alloc); + PyMem_SetAllocator(PYMEM_DOMAIN_MEM, &mem_alloc); PyMem_SetAllocator(PYMEM_DOMAIN_OBJ, &obj_alloc); if (strcmp(opt, "pymalloc_debug") == 0) |