File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -136,6 +136,18 @@ _PyMem_RawFree(void *Py_UNUSED(ctx), void *ptr)
136
136
137
137
#ifdef WITH_MIMALLOC
138
138
139
+ static void
140
+ _PyMimalloc_Config (void ) {
141
+ /* XXX Some options cannot be changed because
142
+ PyRuntime_Initialize() -> alloc_for_runtime()
143
+ allocates memory, which initializes mimalloc.
144
+
145
+ verbose logging breaks some tests in debug mode:
146
+ "pointer might not point to a valid heap region"
147
+ */
148
+ mi_option_disable (mi_option_verbose );
149
+ }
150
+
139
151
static void *
140
152
_PyMimalloc_Malloc (void * ctx , size_t size )
141
153
{
@@ -429,6 +441,10 @@ _PyMem_SetupAllocators(PyMemAllocatorName allocator)
429
441
if (allocator == PYMEM_ALLOCATOR_MIMALLOC_DEBUG ) {
430
442
PyMem_SetupDebugHooks ();
431
443
}
444
+
445
+ // set global mimalloc flags
446
+ _PyMimalloc_Config ();
447
+
432
448
break ;
433
449
}
434
450
#endif
You can’t perform that action at this time.
0 commit comments