static void cont_mark(void *ptr) { RUBY_MARK_ENTER("cont"); if (ptr) { rb_context_t *cont = ptr; rb_gc_mark(cont->value); rb_gc_mark(cont->prev); rb_thread_mark(&cont->saved_thread); if (cont->vm_stack) { rb_gc_mark_locations(cont->vm_stack, cont->vm_stack + cont->saved_thread.stack_size); } if (cont->machine_stack) { rb_gc_mark_locations(cont->machine_stack, cont->machine_stack + cont->machine_stack_size); } #ifdef __ia64 if (cont->machine_register_stack) { rb_gc_mark_locations(cont->machine_register_stack, cont->machine_register_stack + cont->machine_register_stack_size); } #endif } RUBY_MARK_LEAVE("cont"); }
static void cont_mark(void *ptr) { RUBY_MARK_ENTER("cont"); if (ptr) { rb_context_t *cont = ptr; rb_gc_mark(cont->value); rb_thread_mark(&cont->saved_thread); if (cont->vm_stack) { #ifdef CAPTURE_JUST_VALID_VM_STACK rb_gc_mark_locations(cont->vm_stack, cont->vm_stack + cont->vm_stack_slen + cont->vm_stack_clen); #else rb_gc_mark_localtion(cont->vm_stack, cont->vm_stack, cont->saved_thread.stack_size); #endif } if (cont->machine_stack) { rb_gc_mark_locations(cont->machine_stack, cont->machine_stack + cont->machine_stack_size); } #ifdef __ia64 if (cont->machine_register_stack) { rb_gc_mark_locations(cont->machine_register_stack, cont->machine_register_stack + cont->machine_register_stack_size); } #endif } RUBY_MARK_LEAVE("cont"); }
static void cont_mark(void *ptr) { RUBY_MARK_ENTER("cont"); if (ptr) { rb_context_t *cont = ptr; rb_gc_mark(cont->value); rb_thread_mark(&cont->saved_thread); rb_gc_mark(cont->saved_thread.self); if (cont->vm_stack) { #ifdef CAPTURE_JUST_VALID_VM_STACK rb_gc_mark_locations(cont->vm_stack, cont->vm_stack + cont->vm_stack_slen + cont->vm_stack_clen); #else rb_gc_mark_locations(cont->vm_stack, cont->vm_stack, cont->saved_thread.stack_size); #endif } if (cont->machine.stack) { if (cont->type == CONTINUATION_CONTEXT) { /* cont */ rb_gc_mark_locations(cont->machine.stack, cont->machine.stack + cont->machine.stack_size); } else { /* fiber */ rb_thread_t *th; rb_fiber_t *fib = (rb_fiber_t*)cont; GetThreadPtr(cont->saved_thread.self, th); if ((th->fiber != fib) && fib->status == RUNNING) { rb_gc_mark_locations(cont->machine.stack, cont->machine.stack + cont->machine.stack_size); } } } #ifdef __ia64 if (cont->machine.register_stack) { rb_gc_mark_locations(cont->machine.register_stack, cont->machine.register_stack + cont->machine.register_stack_size); } #endif } RUBY_MARK_LEAVE("cont"); }