summaryrefslogtreecommitdiffstats
path: root/Objects/obmalloc.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2023-10-30 22:05:49 (GMT)
committerGitHub <noreply@github.com>2023-10-30 22:05:49 (GMT)
commitda4d3142a247fc77da508a4b3261e6642a196052 (patch)
tree4aaa3a0ed012839a1ec18411af398a7316dc2e60 /Objects/obmalloc.c
parent804a207c168b876112984709edc3a94afa433c69 (diff)
downloadcpython-da4d3142a247fc77da508a4b3261e6642a196052.zip
cpython-da4d3142a247fc77da508a4b3261e6642a196052.tar.gz
cpython-da4d3142a247fc77da508a4b3261e6642a196052.tar.bz2
gh-90815: Fix _PyMem_MimallocEnabled() compiler warning (#111522)
Don't declare _PyMem_MimallocEnabled() if WITH_PYMALLOC macro is not defined (./configure --without-pymalloc). Fix also a typo in _PyInterpreterState_FinalizeAllocatedBlocks().
Diffstat (limited to 'Objects/obmalloc.c')
-rw-r--r--Objects/obmalloc.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/Objects/obmalloc.c b/Objects/obmalloc.c
index 5927d16..d230bbd 100644
--- a/Objects/obmalloc.c
+++ b/Objects/obmalloc.c
@@ -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)
{
@@ -579,7 +578,7 @@ _PyMem_PymallocEnabled(void)
return (_PyObject.malloc == _PyObject_Malloc);
}
}
-#endif
+
#ifdef WITH_MIMALLOC
static int
_PyMem_MimallocEnabled(void)
@@ -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
@@ -1073,7 +1073,7 @@ _PyInterpreterState_GetAllocatedBlocks(PyInterpreterState *interp)
void
_PyInterpreterState_FinalizeAllocatedBlocks(PyInterpreterState *interp)
{
-#ifdef WITH_MIAMLLOC
+#ifdef WITH_MIMALLOC
if (_PyMem_MimallocEnabled()) {
return;
}