From 773862b3335790245f0057324a1e7ad8a3995c4d Mon Sep 17 00:00:00 2001 From: Jake Hughes Date: Wed, 21 Aug 2024 21:08:18 +0100 Subject: [PATCH] Remove old POSIX TLS APIs We have now switched to using fast TLS support, so this old POSIX get/set_specific support for tracking GC roots in TLS is no longer required. --- alloc.c | 12 ------------ include/gc/gc.h | 3 --- pthread_stop_world.c | 2 -- 3 files changed, 17 deletions(-) diff --git a/alloc.c b/alloc.c index 167309226..4896fbcd5 100644 --- a/alloc.c +++ b/alloc.c @@ -1861,15 +1861,3 @@ GC_INNER ptr_t GC_allocobj(size_t lg, int k) GC_fail_count = 0; return (ptr_t)(*flh); } - -STATIC __thread void* tls_rootset = NULL; - -GC_INNER void GC_init_tls_rootset(void * rootset) -{ - tls_rootset = rootset; -} - -GC_INNER void* GC_tls_rootset() -{ - return tls_rootset; -} diff --git a/include/gc/gc.h b/include/gc/gc.h index b52443620..41882ca86 100644 --- a/include/gc/gc.h +++ b/include/gc/gc.h @@ -2358,7 +2358,4 @@ GC_API void GC_CALL GC_win32_free_heap(void); } /* extern "C" */ #endif -GC_API void GC_init_tls_rootset(void * rootset); -GC_API void * GC_tls_rootset(); - #endif /* GC_H */ diff --git a/pthread_stop_world.c b/pthread_stop_world.c index b8bf0d173..5c617ba06 100644 --- a/pthread_stop_world.c +++ b/pthread_stop_world.c @@ -398,7 +398,6 @@ STATIC void GC_suspend_handler_inner(ptr_t dummy, void *context) } crtn = me -> crtn; GC_store_stack_ptr(crtn); - crtn -> tls_rootset = GC_tls_rootset(); get_thread_local_roots(&tlr); crtn -> compiler_thread_roots = tlr; @@ -834,7 +833,6 @@ GC_INNER void GC_push_all_stacks(void) if (me != NULL) { struct GC_ThreadLocalRoots tlr; get_thread_local_roots(&tlr); - me -> crtn -> tls_rootset = GC_tls_rootset(); me -> crtn -> compiler_thread_roots = tlr; }