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-03-17 15:01:21 +0300
commitad112a13bdfb04ae7ff768668ba6616577cc100d (patch)
tree2d84d8e12c239a2f8a6542865c76c330b42bd7b7 /win32_threads.c
parent6c63aba2e25ed05005e49a12e187e03063732dd1 (diff)
downloadbdwgc-ad112a13bdfb04ae7ff768668ba6616577cc100d.tar.gz
Fix assertion violation of GC_thread_key alignment if pthread-based TLS
(fix of commit d692eb432) 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). * thread_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 bef0a224..434350a7 100644
--- a/win32_threads.c
+++ b/win32_threads.c
@@ -1247,7 +1247,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