Skip to content

Commit d61b95f

Browse files
committed
disable verbose debug messages
1 parent 638e58d commit d61b95f

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Objects/obmalloc.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,18 @@ _PyMem_RawFree(void *ctx, void *ptr)
136136

137137
#ifdef WITH_MIMALLOC
138138

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+
139151
static void *
140152
_PyMimalloc_Malloc(void *ctx, size_t size)
141153
{
@@ -428,6 +440,10 @@ _PyMem_SetupAllocators(PyMemAllocatorName allocator)
428440
if (allocator == PYMEM_ALLOCATOR_MIMALLOC_DEBUG) {
429441
PyMem_SetupDebugHooks();
430442
}
443+
444+
// set global mimalloc flags
445+
_PyMimalloc_Config();
446+
431447
break;
432448
}
433449
#endif

0 commit comments

Comments
 (0)