diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2021-06-18 21:12:35 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2021-06-18 21:12:35 +0300 |
commit | 8fbb53983eb2229260edd6527d146ca9056f9b1a (patch) | |
tree | 8e3f244d6f80b85a2e9e250f7f520273e5bf1042 /os_dep.c | |
parent | 9775d933c8dc8bae75f3f02624c2c244aba5ce21 (diff) | |
download | bdwgc-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.c | 26 |
1 files changed, 12 insertions, 14 deletions
@@ -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; |