diff options
author | Samuel Williams <[email protected]> | 2025-04-17 22:21:51 +0900 |
---|---|---|
committer | <[email protected]> | 2025-04-17 13:21:51 +0000 |
commit | c4ae6cb5005cfa53be0af466a5619e7455c15744 () | |
tree | e7ef4d21cab0c9bb4253ca9f00c19c5d73b86e2e /thread_pthread.c | |
parent | 6062c904ae2c4d6a9fafb1a0e22841da85892eea (diff) |
Prefer `th->ec` for stack base/size. (#13101)
Notes: Merged-By: ioquatix <[email protected]>
-rw-r--r-- | thread_pthread.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -3149,8 +3149,12 @@ ruby_stack_overflowed_p(const rb_thread_t *th, const void *addr) const size_t water_mark = 1024 * 1024; STACK_GROW_DIR_DETECTION; #ifdef STACKADDR_AVAILABLE - if (get_stack(&base, &size) == 0) { # ifdef __APPLE__ if (pthread_equal(th->nt->thread_id, native_main_thread.id)) { struct rlimit rlim; @@ -3161,15 +3165,11 @@ ruby_stack_overflowed_p(const rb_thread_t *th, const void *addr) # endif base = (char *)base + STACK_DIR_UPPER(+size, -size); } - else #endif - if (th) { - size = th->ec->machine.stack_maxsize; - base = (char *)th->ec->machine.stack_start - STACK_DIR_UPPER(0, size); - } else { return 0; } size /= RUBY_STACK_SPACE_RATIO; if (size > water_mark) size = water_mark; if (IS_STACK_DIR_UPPER()) { |