summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-09 05:06:41 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-09 05:06:41 +0000
commit9d09240d9e329bbe5a8168dd850f5bb3549fbaa9 (patch)
treee22cadfa88ec235f9630197c0c3a56ce6cbe4850 /thread.c
parent62b885b0900fa8949d794fccce44787e5669f16e (diff)
rb_execution_context_t: move stack, stack_size and cfp from rb_thread_t
The goal is to reduce rb_context_t and rb_fiber_t size by removing the need to store the entire rb_thread_t in there. [ruby-core:81045] Work-in-progress: soon, we will move more fields here. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58614 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/thread.c b/thread.c
index 0c843adabb..13e0b21b42 100644
--- a/thread.c
+++ b/thread.c
@@ -690,8 +690,8 @@ thread_start_func_2(rb_thread_t *th, VALUE *stack_start, VALUE *register_stack_s
rb_check_deadlock(th->vm);
if (!th->root_fiber) {
- rb_thread_recycle_stack_release(th->stack);
- th->stack = 0;
+ rb_thread_recycle_stack_release(th->ec.stack);
+ th->ec.stack = 0;
}
}
native_mutex_lock(&th->vm->thread_destruct_lock);
@@ -2095,7 +2095,8 @@ rb_threadptr_execute_interrupts(rb_thread_t *th, int blocking_timing)
if (th->status == THREAD_RUNNABLE)
th->running_time_us += TIME_QUANTUM_USEC;
- EXEC_EVENT_HOOK(th, RUBY_INTERNAL_EVENT_SWITCH, th->cfp->self, 0, 0, 0, Qundef);
+ EXEC_EVENT_HOOK(th, RUBY_INTERNAL_EVENT_SWITCH, th->ec.cfp->self,
+ 0, 0, 0, Qundef);
rb_thread_schedule_limits(limits_us);
}
@@ -4996,7 +4997,7 @@ rb_check_deadlock(rb_vm_t *vm)
static void
update_coverage(rb_event_flag_t event, VALUE proc, VALUE self, ID id, VALUE klass)
{
- VALUE coverage = rb_iseq_coverage(GET_THREAD()->cfp->iseq);
+ VALUE coverage = rb_iseq_coverage(GET_THREAD()->ec.cfp->iseq);
if (RB_TYPE_P(coverage, T_ARRAY) && !RBASIC_CLASS(coverage)) {
long line = rb_sourceline() - 1;
long count;