diff --git a/src/init.c b/src/init.c index ef824e3a..ef44d273 100644 --- a/src/init.c +++ b/src/init.c @@ -102,6 +102,7 @@ mi_decl_cache_align const mi_heap_t _mi_heap_empty = { false }; + // the thread-local default heap for allocation mi_decl_thread mi_heap_t* _mi_heap_default = (mi_heap_t*)&_mi_heap_empty; @@ -478,10 +479,11 @@ static void mi_detect_cpu_features(void) { void mi_process_init(void) mi_attr_noexcept { // ensure we are called once if (_mi_process_is_initialized) return; - _mi_process_is_initialized = true; mi_process_setup_auto_thread_done(); _mi_verbose_message("process init: 0x%zx\n", _mi_thread_id()); + _mi_process_is_initialized = true; + mi_detect_cpu_features(); _mi_os_init(); mi_heap_main_init();