ruby-changes:48331
From: ko1 <ko1@a...>
Date: Thu, 26 Oct 2017 19:50:49 +0900 (JST)
Subject: [ruby-changes:48331] ko1:r60445 (trunk): A function accepts `ec` instead of `th`.
ko1 2017-10-26 19:50:45 +0900 (Thu, 26 Oct 2017) New Revision: 60445 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=60445 Log: A function accepts `ec` instead of `th`. * vm.c (VM_CFP_IN_HEAP_P): accepts `ec` instead of `th`. Modified files: trunk/vm.c Index: vm.c =================================================================== --- vm.c (revision 60444) +++ vm.c (revision 60445) @@ -86,10 +86,10 @@ rb_vm_frame_block_handler(const rb_contr https://github.com/ruby/ruby/blob/trunk/vm.c#L86 #if VM_CHECK_MODE > 0 static int -VM_CFP_IN_HEAP_P(const rb_thread_t *th, const rb_control_frame_t *cfp) +VM_CFP_IN_HEAP_P(const rb_execution_context_t *ec, const rb_control_frame_t *cfp) { - const VALUE *start = th->ec->vm_stack; - const VALUE *end = (VALUE *)th->ec->vm_stack + th->ec->vm_stack_size; + const VALUE *start = ec->vm_stack; + const VALUE *end = (VALUE *)ec->vm_stack + ec->vm_stack_size; VM_ASSERT(start != NULL); if (start <= (VALUE *)cfp && (VALUE *)cfp < end) { @@ -147,7 +147,7 @@ rb_vm_ep_in_heap_p(const VALUE *ep) https://github.com/ruby/ruby/blob/trunk/vm.c#L147 static struct rb_captured_block * VM_CFP_TO_CAPTURED_BLOCK(const rb_control_frame_t *cfp) { - VM_ASSERT(!VM_CFP_IN_HEAP_P(GET_THREAD(), cfp)); + VM_ASSERT(!VM_CFP_IN_HEAP_P(GET_EC(), cfp)); return (struct rb_captured_block *)&cfp->self; } @@ -155,7 +155,7 @@ static rb_control_frame_t * https://github.com/ruby/ruby/blob/trunk/vm.c#L155 VM_CAPTURED_BLOCK_TO_CFP(const struct rb_captured_block *captured) { rb_control_frame_t *cfp = ((rb_control_frame_t *)((VALUE *)(captured) - 3)); - VM_ASSERT(!VM_CFP_IN_HEAP_P(GET_THREAD(), cfp)); + VM_ASSERT(!VM_CFP_IN_HEAP_P(GET_EC(), cfp)); VM_ASSERT(sizeof(rb_control_frame_t)/sizeof(VALUE) == 6 + VM_DEBUG_BP_CHECK ? 1 : 0); return cfp; } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/