mimalloc/include
Danny Lin ad2fa2bf6f
Fix thread ID getter on Android ARM/AArch64
Android's Bionic libc stores the thread ID in TLS slot 1 instead of 0
on 32-bit ARM and AArch64. Slot 0 contains a pointer to the ELF DTV
(Dynamic Thread Vector) instead, which is constant for each loaded DSO.

Because mimalloc uses the thread ID to determine whether operations are
thread-local or cross-thread (atomic), all threads having the same ID
causes internal data structures to get corrupted quickly when multiple
threads are using the allocator:

mimalloc: assertion failed: at "external/mimalloc/src/page.c":563, mi_page_extend_free
  assertion: "page->local_free == NULL"
mimalloc: assertion failed: at "external/mimalloc/src/page.c":74, mi_page_is_valid_init
  assertion: "page->used <= page->capacity"
mimalloc: assertion failed: at "external/mimalloc/src/page.c":100, mi_page_is_valid_init
  assertion: "page->used + free_count == page->capacity"
mimalloc: assertion failed: at "external/mimalloc/src/page.c":74, mi_page_is_valid_init
  assertion: "page->used <= page->capacity"

Add support for Android's alternate TLS layout to fix the crashes in
multi-threaded use cases.

Fixes #376.
2021-04-07 01:59:47 -07:00
..
mimalloc-atomic.h rename <Windows.h> include to <windows.h> for mingw compatibility (see pr #367) 2021-02-22 13:04:11 -08:00
mimalloc-internal.h Fix thread ID getter on Android ARM/AArch64 2021-04-07 01:59:47 -07:00
mimalloc-new-delete.h fix noexcept attribute on array delete operators 2020-02-02 22:04:53 -08:00
mimalloc-override.h Fix strndup override 2020-12-13 01:50:31 -05:00
mimalloc-types.h Unify statistic collection: 2020-11-11 11:41:39 +03:00
mimalloc.h bump version to 1.7.1 2021-04-06 10:56:26 -07:00