summaryrefslogtreecommitdiff
path: root/win32_threads.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2022-03-17 09:56:10 +0300
committerIvan Maidanski <ivmai@mail.ru>2022-04-24 11:37:07 +0300
commit0fc00253ac93b954e59891a8d4ad4e26b7c0ce3f (patch)
tree4488be39079088372057a8b7d5941280d6112cc7 /win32_threads.c
parent93bab693ac4543aaa04f8b0cc07d496394e26b51 (diff)
downloadbdwgc-0fc00253ac93b954e59891a8d4ad4e26b7c0ce3f.tar.gz
Fix assertion violation of GC_thread_key alignment if pthread-based TLS
(a cherry-pick of commit c496e9755 from 'release-8_2') It is needed to push GC_thread_key only in case of USE_CUSTOM_SPECIFIC; it could have any alignment otherwise (e.g., if it is of pthread_key_t type). * pthread_support.c [THREAD_LOCAL_ALLOC] (GC_push_thread_structures): Push GC_thread_key only if USE_CUSTOM_SPECIFIC. * win32_threads.c [THREAD_LOCAL_ALLOC] (GC_push_thread_structures): Likewise. * thread_local_alloc.c [THREAD_LOCAL_ALLOC] (GC_init_thread_local): Do not assert GC_thread_key is word-aligned unless USE_CUSTOM_SPECIFIC; add comment.
Diffstat (limited to 'win32_threads.c')
-rw-r--r--win32_threads.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/win32_threads.c b/win32_threads.c
index 1b43c194..9f573219 100644
--- a/win32_threads.c
+++ b/win32_threads.c
@@ -1196,7 +1196,7 @@ void GC_push_thread_structures(void)
/* else */ {
GC_PUSH_ALL_SYM(GC_threads);
}
-# if defined(THREAD_LOCAL_ALLOC)
+# if defined(THREAD_LOCAL_ALLOC) && defined(USE_CUSTOM_SPECIFIC)
GC_PUSH_ALL_SYM(GC_thread_key);
/* Just in case we ever use our own TLS implementation. */
# endif