summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2023-03-09 22:36:10 +0300
committerIvan Maidanski <ivmai@mail.ru>2023-03-09 22:36:10 +0300
commit1908d8242271880100f24bb685919b3e6a0c1b2f (patch)
tree628510978c4fe05c212285eee3a2f95767cb9aef /include
parentb49d1aefc29bf6623888abe885b9ac9b85a970df (diff)
downloadbdwgc-1908d8242271880100f24bb685919b3e6a0c1b2f.tar.gz
Remove MAIN_THREAD flag in GC_thread
(refactoring) * darwin_stop_world.c (GC_stack_range_for): Do not check MAIN_THREAD bit of p->flags. * pthread_stop_world.c (GC_push_all_stacks): Likewise. * pthread_support.c [!GC_WIN32_THREADS] (GC_set_stackbottom, GC_get_my_stackbottom): Likewise. * pthread_support.c [!GC_WIN32_THREADS] (GC_call_with_gc_active): Likewise. * darwin_stop_world.c (GC_stack_range_for): Do not use GC_stackbottom. * pthread_stop_world.c (GC_push_all_stacks): Likewise. * pthread_support.c [!GC_WIN32_THREADS] (GC_get_my_stackbottom): Likewise. * dyn_load.c [(SCO_ELF || DGUX || HURD || NACL || __ELF__ && (LINUX || FREEBSD || NETBSD || OPENBSD)) && USE_PROC_FOR_LIBRARIES] (GC_register_map_entries): Do not check GC_stackbottom if THREADS. * include/gc/gc.h (GC_stackbottom): Refine comment (mention that it could be change only before GC initialization if multi-threaded, mention GC_set_stackbottom). * include/private/gcconfig.h [IA64 && (HPUX || LINUX)] (BACKING_STORE_BASE): Remove. * include/private/pthread_support.h [!GC_WIN32_THREADS] (MAIN_THREAD): Likewise. * mark_rts.c [!THREADS && IA64] (GC_push_current_stack): Use GC_register_stackbottom instead of BACKING_STORE_BASE. * pthread_stop_world.c [IA64] (GC_push_all_stacks): Do not use BACKING_STORE_BASE (GC_register_stackbottom). * pthread_support.c [!GC_WIN32_THREADS] (GC_thr_init): Do not set MAIN_THREAD bit of me->flags. * pthread_support.c (GC_set_stackbottom, GC_get_my_stackbottom): Move crtn local variable to outer scope. * pthread_support.c [!GC_WIN32_THREADS] (GC_set_stackbottom): Do not set GC_stackbottom (and GC_register_stackbottom) if GC is initialized. * pthread_support.c [!GC_WIN32_THREADS && IA64] (GC_get_my_stackbottom): Do not use GC_register_stackbottom. * pthread_support.c (GC_call_with_gc_active): Move stack_end local variable to outer scope. * pthread_support.c [!GC_WIN32_THREADS] (GC_call_with_gc_active): Do not use and set GC_stackbottom.
Diffstat (limited to 'include')
-rw-r--r--include/gc/gc.h14
-rw-r--r--include/private/gcconfig.h2
-rw-r--r--include/private/pthread_support.h3
3 files changed, 9 insertions, 10 deletions
diff --git a/include/gc/gc.h b/include/gc/gc.h
index 811add18..bf64d2d9 100644
--- a/include/gc/gc.h
+++ b/include/gc/gc.h
@@ -382,11 +382,15 @@ GC_API GC_ATTR_DEPRECATED char *GC_stackbottom;
/* potentially some signals that can */
/* confuse debuggers. Otherwise the */
/* collector attempts to set it */
- /* automatically. */
- /* For multi-threaded code, this is the */
- /* cold end of the stack for the */
- /* primordial thread. Portable clients */
- /* should use GC_get_stack_base(), */
+ /* automatically. For multi-threaded */
+ /* code, this is the cold end of the */
+ /* stack for the primordial thread. */
+ /* For multi-threaded code, altering */
+ /* GC_stackbottom value directly after */
+ /* GC initialization has no effect. */
+ /* Portable clients should use */
+ /* GC_set_stackbottom(), */
+ /* GC_get_stack_base(), */
/* GC_call_with_gc_active() and */
/* GC_register_my_thread() instead. */
diff --git a/include/private/gcconfig.h b/include/private/gcconfig.h
index 839f0ef1..1f25e5c1 100644
--- a/include/private/gcconfig.h
+++ b/include/private/gcconfig.h
@@ -1851,7 +1851,6 @@ EXTERN_C_BEGIN
/* address minus one page. */
# define BACKING_STORE_DISPLACEMENT 0x1000000
# define BACKING_STORE_ALIGNMENT 0x1000
-# define BACKING_STORE_BASE GC_register_stackbottom
/* Known to be wrong for recent HP/UX versions!!! */
# endif
# ifdef LINUX
@@ -1861,7 +1860,6 @@ EXTERN_C_BEGIN
/* TODO: LINUX_STACKBOTTOM does not work on NUE. */
/* We also need the base address of the register stack */
/* backing store. */
-# define BACKING_STORE_BASE GC_register_stackbottom
# define SEARCH_FOR_DATA_START
# ifdef __GNUC__
# define DYNAMIC_LOADING
diff --git a/include/private/pthread_support.h b/include/private/pthread_support.h
index dab3738b..091e153e 100644
--- a/include/private/pthread_support.h
+++ b/include/private/pthread_support.h
@@ -184,9 +184,6 @@ typedef struct GC_Thread_Rep {
/* it unregisters itself, since it */
/* may not return a GC pointer. */
# endif
-# ifndef GC_WIN32_THREADS
-# define MAIN_THREAD 0x4 /* True for the original thread only. */
-# endif
# if (defined(GC_HAVE_PTHREAD_EXIT) || !defined(GC_NO_PTHREAD_CANCEL)) \
&& defined(GC_PTHREADS)
# define DISABLED_GC 0x10 /* Collections are disabled while the */