ruby-changes:64864
From: Nobuyoshi <ko1@a...>
Date: Wed, 13 Jan 2021 23:20:24 +0900 (JST)
Subject: [ruby-changes:64864] 521ad9a13a (master): Moved Fiber methods into core [Feature #17407]
https://git.ruby-lang.org/ruby.git/commit/?id=521ad9a13a From 521ad9a13aef1e1dae4eaff70d3e6b2e358aa095 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Mon, 4 Jan 2021 10:36:38 +0900 Subject: Moved Fiber methods into core [Feature #17407] diff --git a/cont.c b/cont.c index cfd4eca..694c2d9 100644 --- a/cont.c +++ b/cont.c @@ -3060,6 +3060,7 @@ Init_Cont(void) https://github.com/ruby/ruby/blob/trunk/cont.c#L3060 rb_define_alloc_func(rb_cFiber, fiber_alloc); rb_eFiberError = rb_define_class("FiberError", rb_eStandardError); rb_define_singleton_method(rb_cFiber, "yield", rb_fiber_s_yield, -1); + rb_define_singleton_method(rb_cFiber, "current", rb_fiber_s_current, 0); rb_define_method(rb_cFiber, "initialize", rb_fiber_initialize, -1); rb_define_method(rb_cFiber, "blocking?", rb_fiber_blocking_p, 0); rb_define_method(rb_cFiber, "resume", rb_fiber_m_resume, -1); @@ -3068,6 +3069,8 @@ Init_Cont(void) https://github.com/ruby/ruby/blob/trunk/cont.c#L3069 rb_define_method(rb_cFiber, "backtrace_locations", rb_fiber_backtrace_locations, -1); rb_define_method(rb_cFiber, "to_s", fiber_to_s, 0); rb_define_alias(rb_cFiber, "inspect", "to_s"); + rb_define_method(rb_cFiber, "transfer", rb_fiber_m_transfer, -1); + rb_define_method(rb_cFiber, "alive?", rb_fiber_alive_p, 0); rb_define_singleton_method(rb_cFiber, "blocking?", rb_f_fiber_blocking_p, 0); rb_define_singleton_method(rb_cFiber, "scheduler", rb_fiber_scheduler, 0); @@ -3092,6 +3095,8 @@ Init_Cont(void) https://github.com/ruby/ruby/blob/trunk/cont.c#L3095 rb_define_alloc_func(rb_cFiberPool, fiber_pool_alloc); rb_define_method(rb_cFiberPool, "initialize", rb_fiber_pool_initialize, -1); #endif + + rb_provide("fiber.so"); } RUBY_SYMBOL_EXPORT_BEGIN @@ -3107,15 +3112,4 @@ ruby_Init_Continuation_body(void) https://github.com/ruby/ruby/blob/trunk/cont.c#L3112 rb_define_global_function("callcc", rb_callcc, 0); } -void -ruby_Init_Fiber_as_Coroutine(void) -{ -#ifdef HAVE_RB_EXT_RACTOR_SAFE - rb_ext_ractor_safe(true); -#endif - rb_define_method(rb_cFiber, "transfer", rb_fiber_m_transfer, -1); - rb_define_method(rb_cFiber, "alive?", rb_fiber_alive_p, 0); - rb_define_singleton_method(rb_cFiber, "current", rb_fiber_s_current, 0); -} - RUBY_SYMBOL_EXPORT_END diff --git a/ext/fiber/depend b/ext/fiber/depend deleted file mode 100644 index 675263b..0000000 --- a/ext/fiber/depend +++ /dev/null @@ -1,3 +0,0 @@ https://github.com/ruby/ruby/blob/trunk/cont.c#L0 -# AUTOGENERATED DEPENDENCIES START -fiber.o: fiber.c -# AUTOGENERATED DEPENDENCIES END diff --git a/ext/fiber/extconf.rb b/ext/fiber/extconf.rb deleted file mode 100644 index 7f11e0d..0000000 --- a/ext/fiber/extconf.rb +++ /dev/null @@ -1,4 +0,0 @@ https://github.com/ruby/ruby/blob/trunk/cont.c#L0 -# frozen_string_literal: false -require 'mkmf' -create_makefile('fiber') - diff --git a/ext/fiber/fiber.c b/ext/fiber/fiber.c deleted file mode 100644 index 12fcaad..0000000 --- a/ext/fiber/fiber.c +++ /dev/null @@ -1,8 +0,0 @@ https://github.com/ruby/ruby/blob/trunk/cont.c#L0 - -void ruby_Init_Fiber_as_Coroutine(void); - -void -Init_fiber(void) -{ - ruby_Init_Fiber_as_Coroutine(); -} -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/