diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2022-10-14 20:41:28 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2022-10-14 20:41:28 +0300 |
commit | e41f8a9b7a88fa198227e510b1b7292cfc08219a (patch) | |
tree | 7378dd8437bb7600f3dce66ae28db402543f91cf /darwin_stop_world.c | |
parent | 151c88b8142ec025faaba76d2d34e7a1d178acc9 (diff) | |
download | bdwgc-e41f8a9b7a88fa198227e510b1b7292cfc08219a.tar.gz |
Use EXPECT() in checks of MAIN_THREAD bit
(refactoring)
* darwin_stop_world.c [DARWIN_DONT_PARSE_STACK] (GC_stack_range_for):
Expect (p->flags&MAIN_THREAD)==0.
* pthread_stop_world.c (GC_push_all_stacks): Likewise.
* pthread_support.c (GC_set_stackbottom, GC_get_my_stackbottom,
GC_call_with_gc_active): Likewise.
* pthread_support.c [E2K] (GC_get_my_stackbottom): Avoid code
duplication (sb->reg_base=NULL).
Diffstat (limited to 'darwin_stop_world.c')
-rw-r--r-- | darwin_stop_world.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/darwin_stop_world.c b/darwin_stop_world.c index 5291a5a4..35d2aaa5 100644 --- a/darwin_stop_world.c +++ b/darwin_stop_world.c @@ -326,8 +326,8 @@ STATIC ptr_t GC_stack_range_for(ptr_t *phi, thread_act_t thread, GC_thread p, UNUSED_ARG(paltstack_hi); # else /* p is guaranteed to be non-NULL regardless of GC_query_task_threads. */ - *phi = (p->flags & MAIN_THREAD) != 0 ? GC_stackbottom : p->stack_end; - + *phi = EXPECT((p->flags & MAIN_THREAD) == 0, TRUE) ? p->stack_end + : GC_stackbottom; if (p->altstack != NULL && (word)p->altstack <= (word)lo && (word)lo <= (word)p->altstack + p->altstack_size) { *paltstack_lo = lo; |