Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-90815: Fix _PyMem_MimallocEnabled() compiler warning #111522

Merged
merged 1 commit into from
Oct 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 6 additions & 6 deletions Objects/obmalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -561,14 +561,13 @@ _PyMem_GetCurrentAllocatorName(void)
}


#if defined(WITH_PYMALLOC) || defined(WITH_MIMALLOC)
#ifdef WITH_PYMALLOC
static int
_PyMem_DebugEnabled(void)
{
return (_PyObject.malloc == _PyMem_DebugMalloc);
}

#ifdef WITH_PYMALLOC
static int
_PyMem_PymallocEnabled(void)
{
Expand All @@ -579,7 +578,7 @@ _PyMem_PymallocEnabled(void)
return (_PyObject.malloc == _PyObject_Malloc);
}
}
#endif

#ifdef WITH_MIMALLOC
static int
_PyMem_MimallocEnabled(void)
Expand All @@ -591,8 +590,9 @@ _PyMem_MimallocEnabled(void)
return (_PyObject.malloc == _PyObject_MiMalloc);
}
}
#endif
#endif // defined(WITH_PYMALLOC) || defined(WITH_MIMALLOC)
#endif // WITH_MIMALLOC

#endif // WITH_PYMALLOC


static void
Expand Down Expand Up @@ -1073,7 +1073,7 @@ _PyInterpreterState_GetAllocatedBlocks(PyInterpreterState *interp)
void
_PyInterpreterState_FinalizeAllocatedBlocks(PyInterpreterState *interp)
{
#ifdef WITH_MIAMLLOC
#ifdef WITH_MIMALLOC
if (_PyMem_MimallocEnabled()) {
return;
}
Expand Down