mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-06 11:34:38 +03:00
prefix UNUSED,KiB,MiB,GiB; add mi_threadid_t type; add mi_ssize_t
This commit is contained in:
parent
959845540d
commit
28896e5b19
14 changed files with 198 additions and 166 deletions
|
@ -450,7 +450,7 @@ static void mi_process_load(void) {
|
|||
mi_heap_main_init();
|
||||
#if defined(MI_TLS_RECURSE_GUARD)
|
||||
volatile mi_heap_t* dummy = _mi_heap_default; // access TLS to allocate it before setting tls_initialized to true;
|
||||
UNUSED(dummy);
|
||||
MI_UNUSED(dummy);
|
||||
#endif
|
||||
os_preloading = false;
|
||||
atexit(&mi_process_done);
|
||||
|
@ -509,7 +509,7 @@ void mi_process_init(void) mi_attr_noexcept {
|
|||
if (mi_option_is_enabled(mi_option_reserve_os_memory)) {
|
||||
long ksize = mi_option_get(mi_option_reserve_os_memory);
|
||||
if (ksize > 0) {
|
||||
mi_reserve_os_memory((size_t)ksize*KiB, true, true);
|
||||
mi_reserve_os_memory((size_t)ksize*MI_KiB, true, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -548,8 +548,8 @@ static void mi_process_done(void) {
|
|||
#if defined(_WIN32) && defined(MI_SHARED_LIB)
|
||||
// Windows DLL: easy to hook into process_init and thread_done
|
||||
__declspec(dllexport) BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, LPVOID reserved) {
|
||||
UNUSED(reserved);
|
||||
UNUSED(inst);
|
||||
MI_UNUSED(reserved);
|
||||
MI_UNUSED(inst);
|
||||
if (reason==DLL_PROCESS_ATTACH) {
|
||||
mi_process_load();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue