ruby-changes:53627
From: samuel <ko1@a...>
Date: Tue, 20 Nov 2018 19:22:37 +0900 (JST)
Subject: [ruby-changes:53627] samuel:r65858 (trunk): Restore native non-coroutine code path.
samuel 2018-11-20 19:17:04 +0900 (Tue, 20 Nov 2018) New Revision: 65858 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=65858 Log: Restore native non-coroutine code path. Modified files: trunk/cont.c Index: cont.c =================================================================== --- cont.c (revision 65857) +++ cont.c (revision 65858) @@ -27,7 +27,7 @@ https://github.com/ruby/ruby/blob/trunk/cont.c#L27 */ /* - Enable this include to make fiber yield/resume about twice as fast. + Enable FIBER_USE_COROUTINE to make fiber yield/resume much faster by using native assembly implementations. rvm install ruby-head-ioquatix-native-fiber --url https://github.com/ioquatix/ruby --branch native-fiber @@ -832,10 +832,19 @@ fiber_entry(void *arg) https://github.com/ruby/ruby/blob/trunk/cont.c#L832 } #else /* _WIN32 */ +#if defined(FIBER_USE_COROUTINE) COROUTINE fiber_entry(coroutine_context * from, coroutine_context * to) { rb_fiber_start(); } +#else +NORETURN(static void fiber_entry(void *arg)); +static void +fiber_entry(void *arg) +{ + rb_fiber_start(); +} +#endif /* * FreeBSD require a first (i.e. addr) argument of mmap(2) is not NULL @@ -978,7 +987,7 @@ fiber_setcontext(rb_fiber_t *newfib, rb_ https://github.com/ruby/ruby/blob/trunk/cont.c#L987 swapcontext(&oldfib->context, &newfib->context); #endif } -#endif +#endif /* FIBER_USE_NATIVE */ NOINLINE(NORETURN(static void cont_restore_1(rb_context_t *))); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/