summaryrefslogtreecommitdiff
path: root/os_dep.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2021-06-18 21:12:35 +0300
committerIvan Maidanski <ivmai@mail.ru>2021-06-18 21:12:35 +0300
commit8fbb53983eb2229260edd6527d146ca9056f9b1a (patch)
tree8e3f244d6f80b85a2e9e250f7f520273e5bf1042 /os_dep.c
parent9775d933c8dc8bae75f3f02624c2c244aba5ce21 (diff)
downloadbdwgc-8fbb53983eb2229260edd6527d146ca9056f9b1a.tar.gz
Always define default_push_other_roots (code refactoring)
* os_dep.c [!THREADS] (GC_default_push_other_roots): Define macro as 0. * os_dep.c [THREADS && !PCR && !SN_TARGET_PS3] (GC_default_push_other_roots): Define to call GC_push_all_stacks(). * os_dep.c (GC_push_other_roots): Always initialize to GC_default_push_other_roots.
Diffstat (limited to 'os_dep.c')
-rw-r--r--os_dep.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/os_dep.c b/os_dep.c
index 60163a6d..1fd82380 100644
--- a/os_dep.c
+++ b/os_dep.c
@@ -2766,7 +2766,8 @@ GC_INNER void GC_unmap_gap(ptr_t start1, size_t bytes1, ptr_t start2,
/* environment, this is also responsible for marking from */
/* thread stacks. */
#ifndef THREADS
- GC_push_other_roots_proc GC_push_other_roots = 0;
+# define GC_default_push_other_roots 0
+
#else /* THREADS */
# ifdef PCR
@@ -2809,17 +2810,7 @@ STATIC void GC_CALLBACK GC_default_push_other_roots(void)
}
}
-# endif /* PCR */
-
-# if defined(NN_PLATFORM_CTR) || defined(NINTENDO_SWITCH) \
- || defined(GC_PTHREADS) || defined(GC_WIN32_THREADS)
- STATIC void GC_CALLBACK GC_default_push_other_roots(void)
- {
- GC_push_all_stacks();
- }
-# endif
-
-# ifdef SN_TARGET_PS3
+# elif defined(SN_TARGET_PS3)
STATIC void GC_CALLBACK GC_default_push_other_roots(void)
{
ABORT("GC_default_push_other_roots is not implemented");
@@ -2829,11 +2820,18 @@ STATIC void GC_CALLBACK GC_default_push_other_roots(void)
{
ABORT("GC_push_thread_structures is not implemented");
}
-# endif /* SN_TARGET_PS3 */
- GC_push_other_roots_proc GC_push_other_roots = GC_default_push_other_roots;
+# else /* GC_PTHREADS, or GC_WIN32_THREADS, etc. */
+ STATIC void GC_CALLBACK GC_default_push_other_roots(void)
+ {
+ GC_push_all_stacks();
+ }
+# endif
+
#endif /* THREADS */
+GC_push_other_roots_proc GC_push_other_roots = GC_default_push_other_roots;
+
GC_API void GC_CALL GC_set_push_other_roots(GC_push_other_roots_proc fn)
{
GC_push_other_roots = fn;