summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-06-12 07:58:23 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-06-12 07:58:23 +0000
commit3b405a8912b5762197cdec9f78f040956640830b (patch)
tree3a888ff653b362df114a985dce752ac29abdfb65
parentf06daf167b6182d5ee30236695c0ba8d9159c703 (diff)
add a comment for rb_thread_mark()
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--vm.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/vm.c b/vm.c
index 1652418..10c9abc 100644
--- a/vm.c
+++ b/vm.c
@@ -2368,6 +2368,7 @@ rb_thread_mark(void *ptr)
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)
}
}
+ /* 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)
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);