MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / mi_process_load

Function mi_process_load

3rd/mimalloc-2.0.9/src/init.c:536–561  ·  view source on GitHub ↗

Called once by the process loader

Source from the content-addressed store, hash-verified

534
535// Called once by the process loader
536static void mi_process_load(void) {
537 mi_heap_main_init();
538 #if defined(MI_TLS_RECURSE_GUARD)
539 volatile mi_heap_t* dummy = _mi_heap_default; // access TLS to allocate it before setting tls_initialized to true;
540 MI_UNUSED(dummy);
541 #endif
542 os_preloading = false;
543 mi_assert_internal(_mi_is_main_thread());
544 #if !(defined(_WIN32) && defined(MI_SHARED_LIB)) // use Dll process detach (see below) instead of atexit (issue #521)
545 atexit(&mi_process_done);
546 #endif
547 _mi_options_init();
548 mi_process_setup_auto_thread_done();
549 mi_process_init();
550 if (mi_redirected) _mi_verbose_message("malloc is redirected.\n");
551
552 // show message from the redirector (if present)
553 const char* msg = NULL;
554 mi_allocator_init(&msg);
555 if (msg != NULL && (mi_option_is_enabled(mi_option_verbose) || mi_option_is_enabled(mi_option_show_errors))) {
556 _mi_fputs(NULL,NULL,NULL,msg);
557 }
558
559 // reseed random
560 _mi_random_reinit_if_weak(&_mi_heap_main.random);
561}
562
563#if defined(_WIN32) && (defined(_M_IX86) || defined(_M_X64))
564#include <intrin.h>

Callers 2

DllMainFunction · 0.85
_mi_process_initFunction · 0.85

Calls 10

mi_heap_main_initFunction · 0.85
_mi_is_main_threadFunction · 0.85
_mi_options_initFunction · 0.85
mi_process_initFunction · 0.85
_mi_verbose_messageFunction · 0.85
mi_allocator_initFunction · 0.85
mi_option_is_enabledFunction · 0.85
_mi_fputsFunction · 0.85

Tested by

no test coverage detected