mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-05-07 07:49:31 +03:00
commit
e92358ba49
2 changed files with 4 additions and 3 deletions
|
@ -127,6 +127,7 @@ mi_threadid_t _mi_thread_id(void) mi_attr_noexcept;
|
|||
size_t _mi_thread_seq_id(void) mi_attr_noexcept;
|
||||
mi_tld_t* _mi_thread_tld(void) mi_attr_noexcept;
|
||||
void _mi_heap_guarded_init(mi_heap_t* heap);
|
||||
mi_heap_t* _mi_heap_main_get(void);
|
||||
|
||||
// os.c
|
||||
void _mi_os_init(void); // called from process init
|
||||
|
|
|
@ -138,7 +138,7 @@ mi_decl_cache_align const mi_heap_t _mi_heap_empty = {
|
|||
MI_MEMID_STATIC
|
||||
};
|
||||
|
||||
extern mi_heap_t heap_main;
|
||||
static mi_decl_cache_align mi_heap_t heap_main;
|
||||
|
||||
static mi_decl_cache_align mi_tld_t tld_main = {
|
||||
0, // thread_id
|
||||
|
@ -153,7 +153,7 @@ static mi_decl_cache_align mi_tld_t tld_main = {
|
|||
MI_MEMID_STATIC // memid
|
||||
};
|
||||
|
||||
mi_decl_cache_align mi_heap_t heap_main = {
|
||||
static mi_decl_cache_align mi_heap_t heap_main = {
|
||||
&tld_main, // thread local data
|
||||
NULL, // exclusive arena
|
||||
0, // initial cookie
|
||||
|
@ -266,7 +266,7 @@ static void mi_heap_main_init(void) {
|
|||
}
|
||||
}
|
||||
|
||||
mi_heap_t* heap_main_get(void) {
|
||||
mi_heap_t* _mi_heap_main_get(void) {
|
||||
mi_heap_main_init();
|
||||
return &heap_main;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue