From a8848860b8daf128446c6b507f4f992cde48a6b6 Mon Sep 17 00:00:00 2001 From: samuel Date: Tue, 20 Nov 2018 10:17:04 +0000 Subject: [PATCH] Restore native non-coroutine code path. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65858 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- cont.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/cont.c b/cont.c index 8ae7a4ec37..dd41a16d18 100644 --- a/cont.c +++ b/cont.c @@ -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 *)));