* doc/README.macros (GC_ATTR_TLS_FAST): Document.
* include/private/thread_local_alloc.h (GC_ATTR_TLS_FAST): New macro
(empty by default).
* include/private/thread_local_alloc.h (GC_thread_key): Use
GC_ATTR_TLS_FAST.
* thread_local_alloc.c (GC_thread_key): Likewise.
default in HP/UX. It may help performance on recent Linux installations.
(It failed for me on RedHat 8, but appears to work on RedHat 9.)
+GC_ATTR_TLS_FAST Use specific attributes for GC_thread_key like
+ __attribute__((tls_model("local-exec"))).
+
PARALLEL_MARK Allows the marker to run in multiple threads. Recommended
for multiprocessors.
GC_EXTERN ptr_t * GC_finalized_objfreelist;
#endif
+#ifndef GC_ATTR_TLS_FAST
+# define GC_ATTR_TLS_FAST /* empty */
+#endif
+
extern
#if defined(USE_COMPILER_TLS)
- __thread
+ __thread GC_ATTR_TLS_FAST
#elif defined(USE_WIN32_COMPILER_TLS)
- __declspec(thread)
+ __declspec(thread) GC_ATTR_TLS_FAST
#endif
-GC_key_t GC_thread_key;
+ GC_key_t GC_thread_key;
/* This is set up by the thread_local_alloc implementation. No need */
/* for cleanup on thread exit. But the thread support layer makes sure */
/* that GC_thread_key is traced, if necessary. */
#include <stdlib.h>
#if defined(USE_COMPILER_TLS)
- __thread
+ __thread GC_ATTR_TLS_FAST
#elif defined(USE_WIN32_COMPILER_TLS)
- __declspec(thread)
+ __declspec(thread) GC_ATTR_TLS_FAST
#endif
GC_key_t GC_thread_key;