Skip to content

Commit 1593259

Browse files
committed
Issue python#26249: Try test_capi on Windows
1 parent f5c4b99 commit 1593259

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

Objects/obmalloc.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ _PyObject_ArenaFree(void *ctx, void *ptr, size_t size)
166166
#else
167167
# define PYOBJ_FUNCS PYRAW_FUNCS
168168
#endif
169-
#define PYMEM_FUNCS PYRAW_FUNCS
169+
#define PYMEM_FUNCS PYOBJ_FUNCS
170170

171171
typedef struct {
172172
/* We tag each block with an API ID in order to tag API violations */
@@ -198,9 +198,9 @@ static PyMemAllocatorEx _PyMem_Raw = {
198198

199199
static PyMemAllocatorEx _PyMem = {
200200
#ifdef Py_DEBUG
201-
&_PyMem_Debug.obj, PYDBG_FUNCS
201+
&_PyMem_Debug.mem, PYDBG_FUNCS
202202
#else
203-
NULL, PYOBJ_FUNCS
203+
NULL, PYMEM_FUNCS
204204
#endif
205205
};
206206

@@ -252,11 +252,12 @@ _PyMem_SetupAllocators(const char *opt)
252252
else if (strcmp(opt, "pymalloc") == 0
253253
|| strcmp(opt, "pymalloc_debug") == 0)
254254
{
255-
PyMemAllocatorEx mem_alloc = {NULL, PYRAW_FUNCS};
255+
PyMemAllocatorEx raw_alloc = {NULL, PYRAW_FUNCS};
256+
PyMemAllocatorEx mem_alloc = {NULL, PYMEM_FUNCS};
256257
PyMemAllocatorEx obj_alloc = {NULL, PYOBJ_FUNCS};
257258

258-
PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &mem_alloc);
259-
PyMem_SetAllocator(PYMEM_DOMAIN_MEM, &obj_alloc);
259+
PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &raw_alloc);
260+
PyMem_SetAllocator(PYMEM_DOMAIN_MEM, &mem_alloc);
260261
PyMem_SetAllocator(PYMEM_DOMAIN_OBJ, &obj_alloc);
261262

262263
if (strcmp(opt, "pymalloc_debug") == 0)

0 commit comments

Comments
 (0)