ruby-changes:46954
From: ko1 <ko1@a...>
Date: Mon, 12 Jun 2017 16:58:29 +0900 (JST)
Subject: [ruby-changes:46954] ko1:r59069 (trunk): add a comment for rb_thread_mark()
ko1 2017-06-12 16:58:23 +0900 (Mon, 12 Jun 2017) New Revision: 59069 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=59069 Log: add a comment for rb_thread_mark() Modified files: trunk/vm.c Index: vm.c =================================================================== --- vm.c (revision 59068) +++ vm.c (revision 59069) @@ -2368,6 +2368,7 @@ rb_thread_mark(void *ptr) https://github.com/ruby/ruby/blob/trunk/vm.c#L2368 rb_thread_t *th = ptr; RUBY_MARK_ENTER("thread"); + /* mark VM stack */ if (th->ec.stack) { VALUE *p = th->ec.stack; VALUE *sp = th->ec.cfp->sp; @@ -2389,6 +2390,14 @@ rb_thread_mark(void *ptr) https://github.com/ruby/ruby/blob/trunk/vm.c#L2390 } } + /* mark machine stack */ + if (GET_THREAD() != th && th->machine.stack_start && th->machine.stack_end) { + rb_gc_mark_machine_stack(th); + rb_gc_mark_locations((VALUE *)&th->machine.regs, + (VALUE *)(&th->machine.regs) + + sizeof(th->machine.regs) / sizeof(VALUE)); + } + /* mark ruby objects */ RUBY_MARK_UNLESS_NULL(th->first_proc); if (th->first_proc) RUBY_MARK_UNLESS_NULL(th->first_args); @@ -2412,13 +2421,6 @@ rb_thread_mark(void *ptr) https://github.com/ruby/ruby/blob/trunk/vm.c#L2421 RUBY_MARK_UNLESS_NULL(th->local_storage_recursive_hash); RUBY_MARK_UNLESS_NULL(th->local_storage_recursive_hash_for_trace); - if (GET_THREAD() != th && th->machine.stack_start && th->machine.stack_end) { - rb_gc_mark_machine_stack(th); - rb_gc_mark_locations((VALUE *)&th->machine.regs, - (VALUE *)(&th->machine.regs) + - sizeof(th->machine.regs) / sizeof(VALUE)); - } - RUBY_MARK_UNLESS_NULL(th->name); rb_vm_trace_mark_event_hooks(&th->event_hooks); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/