diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-10-29 13:49:45 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-10-29 13:49:45 +0000 |
commit | 248d3d54a3ea81aaf319b1926a270e7f889aefbe (patch) | |
tree | f0bfcf394abf3412885b0a42fccf8e9cd0cea2af | |
parent | cb81d0ecb1f3948bde2e8ac079c7cf78e92db7a7 (diff) |
rb_ec_stack_check()
* gc.c (rb_ec_stack_check): renamed from rb_threadptr_stack_check()
and it accepts `ec`.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60542 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | eval_intern.h | 2 | ||||
-rw-r--r-- | gc.c | 11 | ||||
-rw-r--r-- | vm_eval.c | 2 |
3 files changed, 7 insertions, 8 deletions
diff --git a/eval_intern.h b/eval_intern.h index f6c033e5fb..d221eca5b7 100644 --- a/eval_intern.h +++ b/eval_intern.h @@ -286,7 +286,7 @@ int rb_threadptr_reset_raised(rb_thread_t *th); #define rb_thread_raised_reset(th, f) ((th)->ec->raised_flag &= ~(f)) #define rb_thread_raised_p(th, f) (((th)->ec->raised_flag & (f)) != 0) #define rb_thread_raised_clear(th) ((th)->ec->raised_flag = 0) -int rb_threadptr_stack_check(rb_thread_t *th); +int rb_ec_stack_check(rb_execution_context_t *ec); VALUE rb_f_eval(int argc, const VALUE *argv, VALUE self); VALUE rb_make_exception(int argc, const VALUE *argv); @@ -4028,9 +4028,8 @@ ruby_stack_length(VALUE **p) #endif #if PREVENT_STACK_OVERFLOW static int -stack_check(rb_thread_t *th, int water_mark) +stack_check(rb_execution_context_t *ec, int water_mark) { - rb_execution_context_t *ec = th->ec; int ret; SET_STACK_END; ret = STACK_LENGTH > STACK_LEVEL_MAX - water_mark; @@ -4043,21 +4042,21 @@ stack_check(rb_thread_t *th, int water_mark) return ret; } #else -#define stack_check(th, water_mark) FALSE +#define stack_check(ec, water_mark) FALSE #endif #define STACKFRAME_FOR_CALL_CFUNC 838 int -rb_threadptr_stack_check(rb_thread_t *th) +rb_ec_stack_check(rb_execution_context_t *ec) { - return stack_check(th, STACKFRAME_FOR_CALL_CFUNC); + return stack_check(ec, STACKFRAME_FOR_CALL_CFUNC); } int ruby_stack_check(void) { - return stack_check(GET_THREAD(), STACKFRAME_FOR_CALL_CFUNC); + return stack_check(GET_EC(), STACKFRAME_FOR_CALL_CFUNC); } ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS @@ -257,7 +257,7 @@ stack_check(rb_execution_context_t *ec) rb_thread_t *th = rb_ec_thread_ptr(ec); if (!rb_thread_raised_p(th, RAISED_STACKOVERFLOW) && - rb_threadptr_stack_check(th)) { + rb_ec_stack_check(ec)) { rb_thread_raised_set(th, RAISED_STACKOVERFLOW); rb_ec_stack_overflow(th->ec, FALSE); } |