diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-09-10 15:49:45 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-09-10 15:49:45 +0000 |
commit | 4f0c9a5cc49cf36f15af85f644982fbb847f0dca (patch) | |
tree | acfb66f8c2b3df4b0572647f35b77a2d5b722ff0 /vm.c | |
parent | 83299c73f36a56442a24de26f049f1a21d724d5c (diff) | |
download | ruby-4f0c9a5cc49cf36f15af85f644982fbb847f0dca.tar.gz |
move th->machine to ec->machine.
* vm_core.h: move rb_thread_t::machine to rb_execution_context_t::machine.
* vm_core.h, gc.c (rb_gc_mark_machine_stack): accept ec instead of th.
it enables to call this func from rb_execution_context_mark() in vm.c.
* cont.c (fiber_setcontext): catch up this fix.
fiber_restore_thread() restores machine stack information too.
* gc.c: catch up structure layout changes.
* thread.c: ditto.
* thread_pthread.c: ditto.
* thread_win32.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59825 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm.c')
-rw-r--r-- | vm.c | 17 |
1 files changed, 9 insertions, 8 deletions
@@ -2390,6 +2390,15 @@ rb_execution_context_mark(const rb_execution_context_t *ec) } } + /* mark machine stack */ + if (&GET_THREAD()->ec != ec && + ec->machine.stack_start && ec->machine.stack_end) { + rb_gc_mark_machine_stack(ec); + rb_gc_mark_locations((VALUE *)&ec->machine.regs, + (VALUE *)(&ec->machine.regs) + + sizeof(ec->machine.regs) / sizeof(VALUE)); + } + RUBY_MARK_UNLESS_NULL(ec->errinfo); RUBY_MARK_UNLESS_NULL(ec->root_svar); rb_mark_tbl(ec->local_storage); @@ -2406,14 +2415,6 @@ rb_thread_mark(void *ptr) rb_execution_context_mark(&th->ec); - /* 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); |