mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
gh-112532: Require mimalloc in --disable-gil
builds (gh-112883)
This commit is contained in:
parent
fed294c645
commit
fdee7b7b3e
10 changed files with 76 additions and 12 deletions
|
@ -576,7 +576,11 @@ static int test_init_from_config(void)
|
|||
_PyPreConfig_InitCompatConfig(&preconfig);
|
||||
|
||||
putenv("PYTHONMALLOC=malloc_debug");
|
||||
#ifndef Py_GIL_DISABLED
|
||||
preconfig.allocator = PYMEM_ALLOCATOR_MALLOC;
|
||||
#else
|
||||
preconfig.allocator = PYMEM_ALLOCATOR_MIMALLOC;
|
||||
#endif
|
||||
|
||||
putenv("PYTHONUTF8=0");
|
||||
Py_UTF8Mode = 0;
|
||||
|
@ -765,7 +769,11 @@ static int test_init_dont_parse_argv(void)
|
|||
static void set_most_env_vars(void)
|
||||
{
|
||||
putenv("PYTHONHASHSEED=42");
|
||||
#ifndef Py_GIL_DISABLED
|
||||
putenv("PYTHONMALLOC=malloc");
|
||||
#else
|
||||
putenv("PYTHONMALLOC=mimalloc");
|
||||
#endif
|
||||
putenv("PYTHONTRACEMALLOC=2");
|
||||
putenv("PYTHONPROFILEIMPORTTIME=1");
|
||||
putenv("PYTHONNODEBUGRANGES=1");
|
||||
|
@ -851,7 +859,11 @@ static int test_init_env_dev_mode_alloc(void)
|
|||
/* Test initialization from environment variables */
|
||||
Py_IgnoreEnvironmentFlag = 0;
|
||||
set_all_env_vars_dev_mode();
|
||||
#ifndef Py_GIL_DISABLED
|
||||
putenv("PYTHONMALLOC=malloc");
|
||||
#else
|
||||
putenv("PYTHONMALLOC=mimalloc");
|
||||
#endif
|
||||
_testembed_Py_InitializeFromConfig();
|
||||
dump_config();
|
||||
Py_Finalize();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue