@@ -561,14 +561,13 @@ _PyMem_GetCurrentAllocatorName(void)
561561}
562562
563563
564- #if defined( WITH_PYMALLOC ) || defined( WITH_MIMALLOC )
564+ #ifdef WITH_PYMALLOC
565565static int
566566_PyMem_DebugEnabled (void )
567567{
568568 return (_PyObject .malloc == _PyMem_DebugMalloc );
569569}
570570
571- #ifdef WITH_PYMALLOC
572571static int
573572_PyMem_PymallocEnabled (void )
574573{
@@ -579,7 +578,7 @@ _PyMem_PymallocEnabled(void)
579578 return (_PyObject .malloc == _PyObject_Malloc );
580579 }
581580}
582- #endif
581+
583582#ifdef WITH_MIMALLOC
584583static int
585584_PyMem_MimallocEnabled (void )
@@ -591,8 +590,8 @@ _PyMem_MimallocEnabled(void)
591590 return (_PyObject .malloc == _PyObject_MiMalloc );
592591 }
593592}
594- #endif
595- #endif // defined( WITH_PYMALLOC) || defined(WITH_MIMALLOC)
593+ #endif // WITH_MIMALLOC
594+ #endif // WITH_PYMALLOC
596595
597596
598597static void
@@ -1028,7 +1027,6 @@ static bool count_blocks(
10281027Py_ssize_t
10291028_PyInterpreterState_GetAllocatedBlocks (PyInterpreterState * interp )
10301029{
1031- #ifdef WITH_MIMALLOC
10321030 // TODO(sgross): this only counts the current thread's blocks.
10331031 if (_PyMem_MimallocEnabled ()) {
10341032 size_t allocated_blocks = 0 ;
@@ -1038,7 +1036,6 @@ _PyInterpreterState_GetAllocatedBlocks(PyInterpreterState *interp)
10381036
10391037 return allocated_blocks ;
10401038 }
1041- #endif
10421039
10431040#ifdef Py_DEBUG
10441041 assert (has_own_state (interp ));
@@ -1073,7 +1070,7 @@ _PyInterpreterState_GetAllocatedBlocks(PyInterpreterState *interp)
10731070void
10741071_PyInterpreterState_FinalizeAllocatedBlocks (PyInterpreterState * interp )
10751072{
1076- #ifdef WITH_MIAMLLOC
1073+ #ifdef WITH_MIMALLOC
10771074 if (_PyMem_MimallocEnabled ()) {
10781075 return ;
10791076 }
0 commit comments