Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 50cbff2

Browse files
committed
Fix build without mimalloc
1 parent be14cd0 commit 50cbff2

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Python/sysmodule.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ Data members:
2020
#include "pycore_code.h" // _Py_QuickenedCount
2121
#include "pycore_frame.h" // _PyInterpreterFrame
2222
#include "pycore_initconfig.h" // _PyStatus_EXCEPTION()
23-
#include "pycore_mimalloc.h" // MI_SECURE, MI_DEBUG
23+
#ifdef WITH_MIMALLOC
24+
# include "pycore_mimalloc.h" // MI_SECURE, MI_DEBUG
25+
#endif
2426
#include "pycore_namespace.h" // _PyNamespace_New()
2527
#include "pycore_object.h" // _PyObject_IS_GC()
2628
#include "pycore_pathconfig.h" // _PyPathConfig_ComputeSysPath0()
@@ -2002,8 +2004,13 @@ make_malloc_info(void)
20022004
#endif
20032005
PyStructSequence_SET_ITEM(malloc_info, pos++, _Py_NewRef(v));
20042006

2007+
#ifdef WITH_MIMALLOC
20052008
SetIntItem(MI_SECURE);
20062009
SetIntItem(MI_DEBUG);
2010+
#else
2011+
SetIntItem(-1);
2012+
SetIntItem(-1);
2013+
#endif
20072014

20082015
#undef SetIntItem
20092016

0 commit comments

Comments
 (0)