1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Restore native non-coroutine code path.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65858 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
samuel 2018-11-20 10:17:04 +00:00
parent 83c84182ad
commit a8848860b8

13
cont.c
View file

@ -27,7 +27,7 @@
*/
/*
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)
}
#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_fiber_t *oldfib)
swapcontext(&oldfib->context, &newfib->context);
#endif
}
#endif
#endif /* FIBER_USE_NATIVE */
NOINLINE(NORETURN(static void cont_restore_1(rb_context_t *)));