summaryrefslogtreecommitdiff
path: root/vm_core.h
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-29 12:57:04 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-29 12:57:04 +0000
commit382aa678d093904762f352063689577b3269a51c (patch)
tree6a1e94bf9c3a88c61ae5b730aadb305957f37893 /vm_core.h
parentc84586b78560028ef14c15e9c23169fe2e6e57ee (diff)
`ec` has `thread_ptr`.
* cont.c (rb_context_struct): move rb_context_t::thread_ptr to rb_execution_context_t::thread_ptr. * cont.c (rb_fiberptr_thread_ptr): removed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60537 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_core.h')
-rw-r--r--vm_core.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/vm_core.h b/vm_core.h
index 512b729e2f..25a5018ba6 100644
--- a/vm_core.h
+++ b/vm_core.h
@@ -771,6 +771,8 @@ typedef struct rb_execution_context_struct {
/* for bmethod */
const rb_callable_method_entry_t *passed_bmethod_me;
+ struct rb_thread_struct *thread_ptr;
+
/* for GC */
struct {
VALUE *stack_start;
@@ -1594,20 +1596,18 @@ RUBY_SYMBOL_EXPORT_END
#define GET_THREAD() ruby_current_thread()
#define GET_EC() ruby_current_execution_context()
-rb_thread_t *rb_fiberptr_thread_ptr(const rb_fiber_t *fib);
-
static inline rb_thread_t *
rb_ec_thread_ptr(const rb_execution_context_t *ec)
{
- return rb_fiberptr_thread_ptr(ec->fiber);
+ return ec->thread_ptr;
}
static inline rb_vm_t *
rb_ec_vm_ptr(const rb_execution_context_t *ec)
{
- const rb_thread_t *th = rb_fiberptr_thread_ptr(ec->fiber);
+ const rb_thread_t *th = rb_ec_thread_ptr(ec);
if (th) {
- return rb_fiberptr_thread_ptr(ec->fiber)->vm;
+ return th->vm;
}
else {
return NULL;