gh-112532: Require mimalloc in --disable-gil builds (gh-112883)

This commit is contained in:
Sam Gross 2023-12-11 19:04:48 -05:00 committed by GitHub
parent fed294c645
commit fdee7b7b3e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 76 additions and 12 deletions

View file

@ -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();