From 6be081a02a82f63dfa03bd8c569fd139981191c0 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Wed, 16 Oct 2024 07:55:10 +0300 Subject: [PATCH] Switch to USE_COMPILER_TLS on Cosmo Issue #666 (bdwgc). In thread-local allocation implementation, use "__thread" keyword to declare GC_thread_key and directly access the key instead of use of pthread_set/getspecific. * include/private/thread_local_alloc.h [!USE_PTHREAD_SPECIFIC && !USE_WIN32_SPECIFIC && !USE_WIN32_COMPILER_TLS && !USE_COMPILER_TLS && !USE_CUSTOM_SPECIFIC && !GC_WIN32_THREADS && !HOST_ANDROID && !(LINUX && GC_GNUC_PREREQ(3,3)) && COSMO && (GC_GNUC_PREREQ(4,4) || GC_CLANG_PREREQ(3,9))] (USE_COMPILER_TLS): Define. --- include/private/thread_local_alloc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/private/thread_local_alloc.h b/include/private/thread_local_alloc.h index 12292f0ac..868682060 100644 --- a/include/private/thread_local_alloc.h +++ b/include/private/thread_local_alloc.h @@ -73,7 +73,7 @@ EXTERN_C_BEGIN # define USE_COMPILER_TLS # endif -# elif (defined(FREEBSD) \ +# elif (defined(COSMO) || defined(FREEBSD) \ || (defined(NETBSD) && __NetBSD_Version__ >= 600000000 /* 6.0 */)) \ && (GC_GNUC_PREREQ(4, 4) || GC_CLANG_PREREQ(3, 9)) # define USE_COMPILER_TLS