Project

General

Profile

Feature #10341 ยป 0001-Remove-unused-prev_fiber-next_fiber-fields.patch

nome (Knut Franke), 10/08/2014 11:59 AM

View differences:

cont.c
140 140
     */
141 141
    int transfered;
142 142

  
143
    struct rb_fiber_struct *prev_fiber;
144
    struct rb_fiber_struct *next_fiber;
145 143
#if FIBER_USE_NATIVE
146 144
#ifdef _WIN32
147 145
    void *fib_handle;
......
319 317
}
320 318

  
321 319
static void
322
fiber_link_join(rb_fiber_t *fib)
323
{
324
    VALUE current_fibval = rb_fiber_current();
325
    rb_fiber_t *current_fib;
326
    GetFiberPtr(current_fibval, current_fib);
327

  
328
    /* join fiber link */
329
    fib->next_fiber = current_fib->next_fiber;
330
    fib->prev_fiber = current_fib;
331
    current_fib->next_fiber->prev_fiber = fib;
332
    current_fib->next_fiber = fib;
333
}
334

  
335
static void
336
fiber_link_remove(rb_fiber_t *fib)
337
{
338
    fib->prev_fiber->next_fiber = fib->next_fiber;
339
    fib->next_fiber->prev_fiber = fib->prev_fiber;
340
}
341

  
342
static void
343 320
fiber_free(void *ptr)
344 321
{
345 322
    RUBY_FREE_ENTER("fiber");
......
349 326
	    fib->cont.saved_thread.local_storage) {
350 327
	    st_free_table(fib->cont.saved_thread.local_storage);
351 328
	}
352
	fiber_link_remove(fib);
353 329

  
354 330
	cont_free(&fib->cont);
355 331
    }
......
1187 1163
    th->stack = 0;
1188 1164
    th->stack_size = 0;
1189 1165

  
1190
    fiber_link_join(fib);
1191

  
1192 1166
    th->stack_size = th->vm->default_params.fiber_vm_stack_size / sizeof(VALUE);
1193 1167
    th->stack = ALLOC_N(VALUE, th->stack_size);
1194 1168

  
......
1331 1305
#endif
1332 1306
#endif
1333 1307
    fib->status = RUNNING;
1334
    fib->prev_fiber = fib->next_fiber = fib;
1335 1308

  
1336 1309
    return fib;
1337 1310
}
1338
-