Project

General

Profile

Bug #1325 » noalloc_fiber.patch

wanabe (_ wanabe), 10/21/2009 12:45 AM

View differences:

cont.c (working copy)
if (ptr) {
rb_fiber_t *fib = ptr;
if (fib->cont.type != ROOT_FIBER_CONTEXT) {
if (fib->cont.type != ROOT_FIBER_CONTEXT &&
fib->cont.saved_thread.local_storage) {
st_free_table(fib->cont.saved_thread.local_storage);
}
fiber_link_remove(fib);
......
cont_init(&fib->cont, th);
fib->prev = Qnil;
fib->status = CREATED;
fib->prev_fiber = fib->next_fiber = fib;
DATA_PTR(fibval) = fib;
......
rb_context_t *cont = &fib->cont;
rb_thread_t *th = &cont->saved_thread;
fiber_link_join(fib);
/* initialize cont */
cont->vm_stack = 0;
......
th->stack_size = FIBER_VM_STACK_SIZE;
th->stack = ALLOC_N(VALUE, th->stack_size);
fiber_link_join(fib);
th->cfp = (void *)(th->stack + th->stack_size);
th->cfp--;
th->cfp->pc = 0;
(2-2/2)