diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-10-05 07:10:25 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-10-05 07:10:25 +0000 |
commit | 37ab3ed99d47a00f28253ea336d127efefd80ac6 (patch) | |
tree | bccee4d60c4f511674d951994c31639fa7687981 /vm_core.h | |
parent | 8b4cf7b7081bbd2d6dd42f3163f5da2cec34689d (diff) |
vm_core.h: vm_thread_with_frame
* vm_core.h (vm_thread_with_frame): skip function call in
GET_THREAD which is empty unless OPT_CALL_CFUNC_WITHOUT_FRAME is
enabled.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52040 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_core.h')
-rw-r--r-- | vm_core.h | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -1061,18 +1061,20 @@ extern rb_event_flag_t ruby_vm_event_flags; #define OPT_CALL_CFUNC_WITHOUT_FRAME 0 #endif +#define GET_THREAD() vm_thread_with_frame(ruby_current_thread) +#if OPT_CALL_CFUNC_WITHOUT_FRAME static inline rb_thread_t * -GET_THREAD(void) +vm_thread_with_frame(rb_thread_t *th) { - rb_thread_t *th = ruby_current_thread; -#if OPT_CALL_CFUNC_WITHOUT_FRAME if (UNLIKELY(th->passed_ci != 0)) { void rb_vm_call_cfunc_push_frame(rb_thread_t *th); rb_vm_call_cfunc_push_frame(th); } -#endif return th; } +#else +#define vm_thread_with_frame(th) (th) +#endif #define rb_thread_set_current_raw(th) (void)(ruby_current_thread = (th)) #define rb_thread_set_current(th) do { \ |