move mi_thread_id to primitives

This commit is contained in:
Daan Leijen 2023-03-14 19:38:45 -07:00
parent 4348a05d0f
commit 3579d3b861
4 changed files with 119 additions and 106 deletions

View file

@ -6,6 +6,7 @@ terms of the MIT license. A copy of the license can be found in the file
-----------------------------------------------------------------------------*/
#include "mimalloc.h"
#include "mimalloc-internal.h"
#include "prim/prim.h"
#include <string.h> // memcpy, memset
#include <stdlib.h> // atexit
@ -103,6 +104,10 @@ mi_decl_cache_align const mi_heap_t _mi_heap_empty = {
};
mi_threadid_t _mi_thread_id(void) mi_attr_noexcept {
return _mi_prim_thread_id();
}
// the thread-local default heap for allocation
mi_decl_thread mi_heap_t* _mi_heap_default = (mi_heap_t*)&_mi_heap_empty;