mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Better support for amd64 platforms
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65835 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
07a324a0f6
commit
990ddcfccf
2 changed files with 15 additions and 9 deletions
18
configure.ac
18
configure.ac
|
|
@ -2274,12 +2274,6 @@ AS_IF([test x"$target_cpu" = xia64], [
|
|||
])
|
||||
])
|
||||
|
||||
AS_CASE(["$target_cpu-$target_os"],
|
||||
[*-darwin*], [
|
||||
AC_LIBOBJ([coroutine/amd64/Context])
|
||||
],
|
||||
)
|
||||
|
||||
AC_CACHE_CHECK(whether right shift preserve sign bit, rb_cv_rshift_sign,
|
||||
[AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([], [(-1==(-1>>1))])],
|
||||
rb_cv_rshift_sign=yes,
|
||||
|
|
@ -2331,6 +2325,18 @@ AS_IF([test "${universal_binary-no}" = yes ], [
|
|||
AC_DEFINE_UNQUOTED(STACK_GROW_DIRECTION, $dir)
|
||||
])
|
||||
|
||||
AC_MSG_CHECKING(native fiber implementation)
|
||||
AS_CASE(["$target_cpu-$target_os"],
|
||||
[x*64-*], [
|
||||
AC_MSG_RESULT(amd64)
|
||||
AC_DEFINE(FIBER_USE_COROUTINE, "coroutine/amd64/Context.h")
|
||||
AC_LIBOBJ([coroutine/amd64/Context])
|
||||
],
|
||||
[*], [
|
||||
AC_MSG_RESULT(no)
|
||||
]
|
||||
)
|
||||
|
||||
AS_IF([test x"$enable_pthread" = xyes], [
|
||||
for pthread_lib in thr pthread pthreads c c_r root; do
|
||||
AC_CHECK_LIB($pthread_lib, pthread_create,
|
||||
|
|
|
|||
6
cont.c
6
cont.c
|
|
@ -29,6 +29,8 @@
|
|||
/*
|
||||
Enable this include to make fiber yield/resume about twice as fast.
|
||||
|
||||
rvm install ruby-head-ioquatix-native-fiber --url https://github.com/ioquatix/ruby --branch native-fiber
|
||||
|
||||
# Without libcoro
|
||||
koyoko% ./build/bin/ruby ./fiber_benchmark.rb 10000 1000
|
||||
setup time for 10000 fibers: 0.099961
|
||||
|
|
@ -40,10 +42,8 @@
|
|||
execution time for 1000 messages: 8.491746
|
||||
*/
|
||||
|
||||
#define FIBER_USE_COROUTINE
|
||||
|
||||
#ifdef FIBER_USE_COROUTINE
|
||||
#include "coroutine/amd64/Context.h"
|
||||
#include FIBER_USE_COROUTINE
|
||||
#define FIBER_USE_NATIVE 1
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue