From ff62c6ffea6cc6c52f4963474016236c9f5e5cf8 Mon Sep 17 00:00:00 2001 From: Jamie Reece Wilson Date: Sat, 26 Aug 2023 21:56:01 +0100 Subject: [PATCH] [*] always link to the aurora runtime heap --- include/mimalloc-internal.h | 8 +++++++- src/init.c | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/include/mimalloc-internal.h b/include/mimalloc-internal.h index 145f6f9..d57f65c 100644 --- a/include/mimalloc-internal.h +++ b/include/mimalloc-internal.h @@ -292,7 +292,13 @@ We try to circumvent this in an efficient way: extern const mi_heap_t _mi_heap_empty; // read-only empty heap, initial value of the thread local default heap extern bool _mi_process_is_initialized; -mi_heap_t* _mi_heap_main_get(void); // statically allocated main backing heap +#if defined (MI_TLS_RECURSE_GUARD_HOST) +#define MI_MAIN_VIS __declspec(dllexport) +#else +#define MI_MAIN_VIS +#endif +MI_MAIN_VIS mi_heap_t *_mi_heap_main_get(void); // statically allocated main backing heap + #if defined(MI_MALLOC_OVERRIDE) #if defined(__MACH__) // OSX diff --git a/src/init.c b/src/init.c index 0147e9a..de24f40 100644 --- a/src/init.c +++ b/src/init.c @@ -148,11 +148,12 @@ static void mi_heap_main_init(void) { } } +#if defined(MI_TLS_RECURSE_GUARD_HOST) || !defined(MI_TLS_RECURSE_GUARD) mi_heap_t* _mi_heap_main_get(void) { mi_heap_main_init(); return &_mi_heap_main; } - +#endif /* ----------------------------------------------------------- Initialization and freeing of the thread local heaps