mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
add a comment for rb_thread_mark()
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
f06daf167b
commit
3b405a8912
1 changed files with 9 additions and 7 deletions
16
vm.c
16
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);
|
||||
|
|
Loading…
Add table
Reference in a new issue