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 *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
{
@@ -428,6 +440,10 @@ _PyMem_SetupAllocators(PyMemAllocatorName allocator)
428
440
if (allocator == PYMEM_ALLOCATOR_MIMALLOC_DEBUG ) {
429
441
PyMem_SetupDebugHooks ();
430
442
}
443
+
444
+ // set global mimalloc flags
445
+ _PyMimalloc_Config ();
446
+
431
447
break ;
432
448
}
433
449
#endif
You can’t perform that action at this time.
0 commit comments