diff options
author | Daan <daanl@outlook.com> | 2021-12-15 16:48:57 -0800 |
---|---|---|
committer | Daan <daanl@outlook.com> | 2021-12-15 16:48:57 -0800 |
commit | 317093d78b9dea347ceeaf15775c74e78e0e5fc7 (patch) | |
tree | 909a4fd7fbc9f9b91fb52d78cc7a17c76efacbb6 /include/mimalloc-internal.h | |
parent | a8b5106ce21bd8ac957249c5a67f80b6eee52187 (diff) |
fix Android overriding (issue #381 and PR #487)
Diffstat (limited to 'include/mimalloc-internal.h')
-rw-r--r-- | include/mimalloc-internal.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/include/mimalloc-internal.h b/include/mimalloc-internal.h index 324ad4a..b8fc754 100644 --- a/include/mimalloc-internal.h +++ b/include/mimalloc-internal.h @@ -317,6 +317,9 @@ mi_heap_t* _mi_heap_main_get(void); // statically allocated main backing hea #elif defined(__DragonFly__) #warning "mimalloc is not working correctly on DragonFly yet." //#define MI_TLS_PTHREAD_SLOT_OFS (4 + 1*sizeof(void*)) // offset `uniqueid` (also used by gdb?) <https://github.com/DragonFlyBSD/DragonFlyBSD/blob/master/lib/libthread_xu/thread/thr_private.h#L458> +#elif defined(__ANDROID__) +// See issue #381 +#define MI_TLS_PTHREAD #endif #endif @@ -766,7 +769,7 @@ static inline void mi_tls_slot_set(size_t slot, void* value) mi_attr_noexcept { } static inline mi_threadid_t _mi_thread_id(void) mi_attr_noexcept { -#if defined(__arm__) || (defined(__BIONIC__) && defined(__aarch64__)) +#if defined(__arm__) || (defined(__ANDROID__) && defined(__aarch64__)) // issue #384, #495: on arm32 and arm32/arm64 Android, slot 1 is the thread ID (pointer to pthread internal struct) return (uintptr_t)mi_tls_slot(1); #else |