Skip to content

Commit

Permalink
Set TLS model on Android depending on target sdk (#347)
Browse files Browse the repository at this point in the history
  • Loading branch information
TroutZhang authored Jan 11, 2025
1 parent d60ad1f commit b443c9d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions rpmalloc/rpmalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,12 @@ static size_t os_page_size;
#if defined(_MSC_VER) && !defined(__clang__)
#define TLS_MODEL
#define _Thread_local __declspec(thread)
#elif defined(__ANDROID__)
#if __ANDROID_API__ >= 29 && defined(__NDK_MAJOR__) && __NDK_MAJOR__ >= 26
#define TLS_MODEL __attribute__((tls_model("local-dynamic")))
#else
#define TLS_MODEL
#endif
#else
// #define TLS_MODEL __attribute__((tls_model("initial-exec")))
#define TLS_MODEL
Expand Down

0 comments on commit b443c9d

Please sign in to comment.