ruby-changes:35877
From: normal <ko1@a...>
Date: Thu, 16 Oct 2014 07:34:44 +0900 (JST)
Subject: [ruby-changes:35877] normal:r47959 (trunk): cont.c: Remove unused prev_fiber/next_fiber fields
normal 2014-10-16 07:34:30 +0900 (Thu, 16 Oct 2014) New Revision: 47959 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=47959 Log: cont.c: Remove unused prev_fiber/next_fiber fields They were added in r19890 (8a0d53a), with the explanation that it's a double linked list of fibers in the same thread, but without any code using them. * cont.c (rb_fiber_t): remove prev_fiber/next_fiber (fiber_link_join, fiber_link_remove): remove functions (fiber_free, fiber_init, root_fiber_alloc): remove references to removed fields and functions [ruby-core:65518] [Feature #10341] Author: Knut Franke <Knut.Franke@g...> Modified files: trunk/ChangeLog trunk/cont.c Index: ChangeLog =================================================================== --- ChangeLog (revision 47958) +++ ChangeLog (revision 47959) @@ -1,3 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Thu Oct 16 04:28:41 2014 Knut Franke <Knut.Franke@g...> + + * cont.c (rb_fiber_t): remove prev_fiber/next_fiber + (fiber_link_join, fiber_link_remove): remove functions + (fiber_free, fiber_init, root_fiber_alloc): + remove references to removed fields and functions + [ruby-core:65518] [Feature #10341] + Wed Oct 15 22:08:37 2014 Tanaka Akira <akr@f...> * ext/etc/etc.c (etc_nprocessors_affin): Test CPU_ALLOC availability. Index: cont.c =================================================================== --- cont.c (revision 47958) +++ cont.c (revision 47959) @@ -140,8 +140,6 @@ typedef struct rb_fiber_struct { https://github.com/ruby/ruby/blob/trunk/cont.c#L140 */ int transfered; - struct rb_fiber_struct *prev_fiber; - struct rb_fiber_struct *next_fiber; #if FIBER_USE_NATIVE #ifdef _WIN32 void *fib_handle; @@ -319,27 +317,6 @@ fiber_mark(void *ptr) https://github.com/ruby/ruby/blob/trunk/cont.c#L317 } static void -fiber_link_join(rb_fiber_t *fib) -{ - VALUE current_fibval = rb_fiber_current(); - rb_fiber_t *current_fib; - GetFiberPtr(current_fibval, current_fib); - - /* join fiber link */ - fib->next_fiber = current_fib->next_fiber; - fib->prev_fiber = current_fib; - current_fib->next_fiber->prev_fiber = fib; - current_fib->next_fiber = fib; -} - -static void -fiber_link_remove(rb_fiber_t *fib) -{ - fib->prev_fiber->next_fiber = fib->next_fiber; - fib->next_fiber->prev_fiber = fib->prev_fiber; -} - -static void fiber_free(void *ptr) { RUBY_FREE_ENTER("fiber"); @@ -349,7 +326,6 @@ fiber_free(void *ptr) https://github.com/ruby/ruby/blob/trunk/cont.c#L326 fib->cont.saved_thread.local_storage) { st_free_table(fib->cont.saved_thread.local_storage); } - fiber_link_remove(fib); cont_free(&fib->cont); } @@ -1187,8 +1163,6 @@ fiber_init(VALUE fibval, VALUE proc) https://github.com/ruby/ruby/blob/trunk/cont.c#L1163 th->stack = 0; th->stack_size = 0; - fiber_link_join(fib); - th->stack_size = th->vm->default_params.fiber_vm_stack_size / sizeof(VALUE); th->stack = ALLOC_N(VALUE, th->stack_size); @@ -1331,7 +1305,6 @@ root_fiber_alloc(rb_thread_t *th) https://github.com/ruby/ruby/blob/trunk/cont.c#L1305 #endif #endif fib->status = RUNNING; - fib->prev_fiber = fib->next_fiber = fib; return fib; } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/