summaryrefslogtreecommitdiff
path: root/include/mimalloc-internal.h
diff options
context:
space:
mode:
authorDaan Leijen <daan@microsoft.com>2021-01-28 17:37:13 -0800
committerDaan Leijen <daan@microsoft.com>2021-01-28 17:37:13 -0800
commit1e9a5c2d789328906d0b25a330d008506d27b654 (patch)
tree03ccc13e2a87b06f4dff0dc50dc6d83c5f45c4da /include/mimalloc-internal.h
parente314699ee0de0c4a9b227970e8c2956f50a49af5 (diff)
parent78ce716e2d5b1572e9b459cba12830e88c892989 (diff)
Merge branch 'dev' into dev-slice
Diffstat (limited to 'include/mimalloc-internal.h')
-rw-r--r--include/mimalloc-internal.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/mimalloc-internal.h b/include/mimalloc-internal.h
index 7d78bf3..15c1e55 100644
--- a/include/mimalloc-internal.h
+++ b/include/mimalloc-internal.h
@@ -831,7 +831,11 @@ static inline void* mi_tls_slot(size_t slot) mi_attr_noexcept {
res = tcb[slot];
#elif defined(__aarch64__)
void** tcb; UNUSED(ofs);
+#if defined(__APPLE__) // issue #343
+ __asm__ volatile ("mrs %0, tpidrro_el0" : "=r" (tcb));
+#else
__asm__ volatile ("mrs %0, tpidr_el0" : "=r" (tcb));
+#endif
res = tcb[slot];
#endif
return res;
@@ -854,7 +858,11 @@ static inline void mi_tls_slot_set(size_t slot, void* value) mi_attr_noexcept {
tcb[slot] = value;
#elif defined(__aarch64__)
void** tcb; UNUSED(ofs);
+#if defined(__APPLE__) // issue #343
+ __asm__ volatile ("mrs %0, tpidrro_el0" : "=r" (tcb));
+#else
__asm__ volatile ("mrs %0, tpidr_el0" : "=r" (tcb));
+#endif
tcb[slot] = value;
#endif
}