mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-05-20 22:19:30 +03:00
Fix _mi_thread_id issue on apple arm64
This commit is contained in:
parent
6327cf12c2
commit
c2f6a86939
1 changed files with 5 additions and 1 deletions
|
@ -744,8 +744,12 @@ static inline void mi_tls_slot_set(size_t slot, void* value) mi_attr_noexcept {
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline uintptr_t _mi_thread_id(void) mi_attr_noexcept {
|
static inline uintptr_t _mi_thread_id(void) mi_attr_noexcept {
|
||||||
// in all our targets, slot 0 is the pointer to the thread control block
|
#if defined(__aarch64__) && defined(__APPLE__)
|
||||||
|
return (uintptr_t)&_mi_heap_default;
|
||||||
|
#else
|
||||||
|
// in all our other targets, slot 0 is the pointer to the thread control block
|
||||||
return (uintptr_t)mi_tls_slot(0);
|
return (uintptr_t)mi_tls_slot(0);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
// otherwise use standard C
|
// otherwise use standard C
|
||||||
|
|
Loading…
Add table
Reference in a new issue