ruby-changes:63625
From: Koichi <ko1@a...>
Date: Wed, 18 Nov 2020 03:53:08 +0900 (JST)
Subject: [ruby-changes:63625] 5e3259ea74 (master): fix public interface
https://git.ruby-lang.org/ruby.git/commit/?id=5e3259ea74 From 5e3259ea7490a2542d78c433eb8c9d44c7819e61 Mon Sep 17 00:00:00 2001 From: Koichi Sasada <ko1@a...> Date: Tue, 17 Nov 2020 16:40:47 +0900 Subject: fix public interface To make some kind of Ractor related extensions, some functions should be exposed. * include/ruby/thread_native.h * rb_native_mutex_* * rb_native_cond_* * include/ruby/ractor.h * RB_OBJ_SHAREABLE_P(obj) * rb_ractor_shareable_p(obj) * rb_ractor_std*() * rb_cRactor and rm ractor_pub.h and rename srcdir/ractor.h to srcdir/ractor_core.h (to avoid conflict with include/ruby/ractor.h) diff --git a/common.mk b/common.mk index 46d1806..7e585d3 100644 --- a/common.mk +++ b/common.mk @@ -3372,7 +3372,7 @@ cont.$(OBJEXT): {$(VPATH)}missing.h https://github.com/ruby/ruby/blob/trunk/common.mk#L3372 cont.$(OBJEXT): {$(VPATH)}mjit.h cont.$(OBJEXT): {$(VPATH)}node.h cont.$(OBJEXT): {$(VPATH)}ractor.h -cont.$(OBJEXT): {$(VPATH)}ractor_pub.h +cont.$(OBJEXT): {$(VPATH)}ractor_core.h cont.$(OBJEXT): {$(VPATH)}ruby_assert.h cont.$(OBJEXT): {$(VPATH)}ruby_atomic.h cont.$(OBJEXT): {$(VPATH)}st.h @@ -3566,7 +3566,7 @@ debug.$(OBJEXT): {$(VPATH)}node.h https://github.com/ruby/ruby/blob/trunk/common.mk#L3566 debug.$(OBJEXT): {$(VPATH)}onigmo.h debug.$(OBJEXT): {$(VPATH)}oniguruma.h debug.$(OBJEXT): {$(VPATH)}ractor.h -debug.$(OBJEXT): {$(VPATH)}ractor_pub.h +debug.$(OBJEXT): {$(VPATH)}ractor_core.h debug.$(OBJEXT): {$(VPATH)}ruby_assert.h debug.$(OBJEXT): {$(VPATH)}ruby_atomic.h debug.$(OBJEXT): {$(VPATH)}st.h @@ -4622,7 +4622,6 @@ encoding.$(OBJEXT): {$(VPATH)}missing.h https://github.com/ruby/ruby/blob/trunk/common.mk#L4622 encoding.$(OBJEXT): {$(VPATH)}node.h encoding.$(OBJEXT): {$(VPATH)}onigmo.h encoding.$(OBJEXT): {$(VPATH)}oniguruma.h -encoding.$(OBJEXT): {$(VPATH)}ractor_pub.h encoding.$(OBJEXT): {$(VPATH)}regenc.h encoding.$(OBJEXT): {$(VPATH)}ruby_assert.h encoding.$(OBJEXT): {$(VPATH)}st.h @@ -5402,7 +5401,7 @@ eval.$(OBJEXT): {$(VPATH)}probes.dmyh https://github.com/ruby/ruby/blob/trunk/common.mk#L5401 eval.$(OBJEXT): {$(VPATH)}probes.h eval.$(OBJEXT): {$(VPATH)}probes_helper.h eval.$(OBJEXT): {$(VPATH)}ractor.h -eval.$(OBJEXT): {$(VPATH)}ractor_pub.h +eval.$(OBJEXT): {$(VPATH)}ractor_core.h eval.$(OBJEXT): {$(VPATH)}ruby_assert.h eval.$(OBJEXT): {$(VPATH)}ruby_atomic.h eval.$(OBJEXT): {$(VPATH)}st.h @@ -5824,7 +5823,7 @@ gc.$(OBJEXT): {$(VPATH)}oniguruma.h https://github.com/ruby/ruby/blob/trunk/common.mk#L5823 gc.$(OBJEXT): {$(VPATH)}probes.dmyh gc.$(OBJEXT): {$(VPATH)}probes.h gc.$(OBJEXT): {$(VPATH)}ractor.h -gc.$(OBJEXT): {$(VPATH)}ractor_pub.h +gc.$(OBJEXT): {$(VPATH)}ractor_core.h gc.$(OBJEXT): {$(VPATH)}re.h gc.$(OBJEXT): {$(VPATH)}regenc.h gc.$(OBJEXT): {$(VPATH)}regex.h @@ -6744,7 +6743,7 @@ io.$(OBJEXT): {$(VPATH)}missing.h https://github.com/ruby/ruby/blob/trunk/common.mk#L6743 io.$(OBJEXT): {$(VPATH)}node.h io.$(OBJEXT): {$(VPATH)}onigmo.h io.$(OBJEXT): {$(VPATH)}oniguruma.h -io.$(OBJEXT): {$(VPATH)}ractor_pub.h +io.$(OBJEXT): {$(VPATH)}ractor.h io.$(OBJEXT): {$(VPATH)}ruby_assert.h io.$(OBJEXT): {$(VPATH)}ruby_atomic.h io.$(OBJEXT): {$(VPATH)}st.h @@ -9756,7 +9755,7 @@ parse.$(OBJEXT): {$(VPATH)}parse.h https://github.com/ruby/ruby/blob/trunk/common.mk#L9755 parse.$(OBJEXT): {$(VPATH)}parse.y parse.$(OBJEXT): {$(VPATH)}probes.dmyh parse.$(OBJEXT): {$(VPATH)}probes.h -parse.$(OBJEXT): {$(VPATH)}ractor_pub.h +parse.$(OBJEXT): {$(VPATH)}ractor.h parse.$(OBJEXT): {$(VPATH)}regenc.h parse.$(OBJEXT): {$(VPATH)}regex.h parse.$(OBJEXT): {$(VPATH)}ruby_assert.h @@ -10179,7 +10178,7 @@ process.$(OBJEXT): {$(VPATH)}node.h https://github.com/ruby/ruby/blob/trunk/common.mk#L10178 process.$(OBJEXT): {$(VPATH)}onigmo.h process.$(OBJEXT): {$(VPATH)}oniguruma.h process.$(OBJEXT): {$(VPATH)}process.c -process.$(OBJEXT): {$(VPATH)}ractor_pub.h +process.$(OBJEXT): {$(VPATH)}ractor.h process.$(OBJEXT): {$(VPATH)}ruby_assert.h process.$(OBJEXT): {$(VPATH)}ruby_atomic.h process.$(OBJEXT): {$(VPATH)}st.h @@ -10384,7 +10383,7 @@ ractor.$(OBJEXT): {$(VPATH)}ractor.c https://github.com/ruby/ruby/blob/trunk/common.mk#L10383 ractor.$(OBJEXT): {$(VPATH)}ractor.h ractor.$(OBJEXT): {$(VPATH)}ractor.rb ractor.$(OBJEXT): {$(VPATH)}ractor.rbinc -ractor.$(OBJEXT): {$(VPATH)}ractor_pub.h +ractor.$(OBJEXT): {$(VPATH)}ractor_core.h ractor.$(OBJEXT): {$(VPATH)}ruby_assert.h ractor.$(OBJEXT): {$(VPATH)}ruby_atomic.h ractor.$(OBJEXT): {$(VPATH)}st.h @@ -14180,7 +14179,7 @@ thread.$(OBJEXT): {$(VPATH)}node.h https://github.com/ruby/ruby/blob/trunk/common.mk#L14179 thread.$(OBJEXT): {$(VPATH)}onigmo.h thread.$(OBJEXT): {$(VPATH)}oniguruma.h thread.$(OBJEXT): {$(VPATH)}ractor.h -thread.$(OBJEXT): {$(VPATH)}ractor_pub.h +thread.$(OBJEXT): {$(VPATH)}ractor_core.h thread.$(OBJEXT): {$(VPATH)}ruby_assert.h thread.$(OBJEXT): {$(VPATH)}ruby_atomic.h thread.$(OBJEXT): {$(VPATH)}st.h @@ -14738,7 +14737,6 @@ transient_heap.$(OBJEXT): {$(VPATH)}internal/xmalloc.h https://github.com/ruby/ruby/blob/trunk/common.mk#L14737 transient_heap.$(OBJEXT): {$(VPATH)}method.h transient_heap.$(OBJEXT): {$(VPATH)}missing.h transient_heap.$(OBJEXT): {$(VPATH)}node.h -transient_heap.$(OBJEXT): {$(VPATH)}ractor_pub.h transient_heap.$(OBJEXT): {$(VPATH)}ruby_assert.h transient_heap.$(OBJEXT): {$(VPATH)}ruby_atomic.h transient_heap.$(OBJEXT): {$(VPATH)}st.h @@ -15106,7 +15104,7 @@ variable.$(OBJEXT): {$(VPATH)}node.h https://github.com/ruby/ruby/blob/trunk/common.mk#L15104 variable.$(OBJEXT): {$(VPATH)}onigmo.h variable.$(OBJEXT): {$(VPATH)}oniguruma.h variable.$(OBJEXT): {$(VPATH)}ractor.h -variable.$(OBJEXT): {$(VPATH)}ractor_pub.h +variable.$(OBJEXT): {$(VPATH)}ractor_core.h variable.$(OBJEXT): {$(VPATH)}ruby_assert.h variable.$(OBJEXT): {$(VPATH)}ruby_atomic.h variable.$(OBJEXT): {$(VPATH)}st.h @@ -15520,7 +15518,7 @@ vm.$(OBJEXT): {$(VPATH)}probes.dmyh https://github.com/ruby/ruby/blob/trunk/common.mk#L15518 vm.$(OBJEXT): {$(VPATH)}probes.h vm.$(OBJEXT): {$(VPATH)}probes_helper.h vm.$(OBJEXT): {$(VPATH)}ractor.h -vm.$(OBJEXT): {$(VPATH)}ractor_pub.h +vm.$(OBJEXT): {$(VPATH)}ractor_core.h vm.$(OBJEXT): {$(VPATH)}ruby_assert.h vm.$(OBJEXT): {$(VPATH)}ruby_atomic.h vm.$(OBJEXT): {$(VPATH)}st.h @@ -15912,7 +15910,7 @@ vm_dump.$(OBJEXT): {$(VPATH)}missing.h https://github.com/ruby/ruby/blob/trunk/common.mk#L15910 vm_dump.$(OBJEXT): {$(VPATH)}node.h vm_dump.$(OBJEXT): {$(VPATH)}procstat_vm.c vm_dump.$(OBJEXT): {$(VPATH)}ractor.h -vm_dump.$(OBJEXT): {$(VPATH)}ractor_pub.h +vm_dump.$(OBJEXT): {$(VPATH)}ractor_core.h vm_dump.$(OBJEXT): {$(VPATH)}ruby_assert.h vm_dump.$(OBJEXT): {$(VPATH)}ruby_atomic.h vm_dump.$(OBJEXT): {$(VPATH)}st.h @@ -16108,7 +16106,7 @@ vm_sync.$(OBJEXT): {$(VPATH)}missing.h https://github.com/ruby/ruby/blob/trunk/common.mk#L16106 vm_sync.$(OBJEXT): {$(VPATH)}node.h vm_sync.$(OBJEXT): {$(VPATH)}procstat_vm.c vm_sync.$(OBJEXT): {$(VPATH)}ractor.h -vm_sync.$(OBJEXT): {$(VPATH)}ractor_pub.h +vm_sync.$(OBJEXT): {$(VPATH)}ractor_core.h vm_sync.$(OBJEXT): {$(VPATH)}ruby_assert.h vm_sync.$(OBJEXT): {$(VPATH)}ruby_atomic.h vm_sync.$(OBJEXT): {$(VPATH)}st.h diff --git a/cont.c b/cont.c index 88ce28b..6c26885 100644 --- a/cont.c +++ b/cont.c @@ -29,7 +29,7 @@ https://github.com/ruby/ruby/blob/trunk/cont.c#L29 #include "mjit.h" #include "vm_core.h" #include "id_table.h" -#include "ractor.h" +#include "ractor_core.h" static const int DEBUG = 0; diff --git a/debug.c b/debug.c index cc6a98a..deec382 100644 --- a/debug.c +++ b/debug.c @@ -26,7 +26,7 @@ https://github.com/ruby/ruby/blob/trunk/debug.c#L26 #include "vm_debug.h" #include "vm_callinfo.h" #include "ruby/thread_native.h" -#include "ractor.h" +#include "ractor_core.h" /* This is the only place struct RIMemo is actually used */ struct RIMemo { diff --git a/encoding.c b/encoding.c index 7336421..e1441ca 100644 --- a/encoding.c +++ b/encoding.c @@ -26,7 +26,6 @@ https://github.com/ruby/ruby/blob/trunk/encoding.c#L26 #include "ruby/encoding.h" #include "ruby/util.h" #include "ruby_assert.h" -#include "ractor_pub.h" #include "vm_sync.h" #ifndef ENC_DEBUG diff --git a/eval.c b/eval.c index a77fb66..be13376 100644 --- a/eval.c +++ b/eval.c @@ -37,7 +37,7 @@ https://github.com/ruby/ruby/blob/trunk/eval.c#L37 #include "probes_helper.h" #include "ruby/vm.h" #include "vm_core.h" -#include "ractor.h" +#include "ractor_core.h" NORETURN(void rb_raise_jump(VALUE, VALUE)); void rb_ec_clear_current_thread_trace_func(const rb_execution_context_t *ec); diff --git a/ext/ripper/depend b/ext/ripper/depend index bfd6738..4ce522f 100644 --- a/ext/ripper/depend +++ b/ext/ripper/depend @@ -210,6 +210,7 @@ ripper.o: $(hdrdir)/ruby/io.h https://github.com/ruby/ruby/blob/trunk/ext/ripper/depend#L210 ripper.o: $(hdrdir)/ruby/missing.h ripper.o: $(hdrdir)/ruby/onigmo.h ripper.o: $(hdrdir)/ruby/oniguruma.h +ripper.o: $(hdrdir)/ruby/ractor.h ripper.o: $(hdrdir)/ruby/regex.h ripper.o: $(hdrdir)/ruby/ruby.h ripper.o: $(hdrdir)/ruby/st.h @@ -244,7 +245,6 @@ ripper.o: $(top_srcdir)/internal/variable.h https://github.com/ruby/ruby/blob/trunk/ext/ripper/depend#L245 ripper.o: $(top_srcdir)/internal/vm.h ripper.o: $(top_srcdir)/internal/warnings.h ripper.o: $(top_srcdir)/node.h -ripper.o: $(top_srcdir)/ractor_pub.h ripper.o: $(top_srcdir)/regenc.h ripper.o: $(top_srcdir)/ruby_assert.h ripper.o: $(top_srcdir)/symbol.h diff --git a/gc.c b/gc.c index a41160a..3dbeeec 100644 --- a/gc.c +++ b/gc.c @@ -112,7 +112,7 @@ https://github.com/ruby/ruby/blob/trunk/gc.c#L112 #include "vm_core.h" #include "vm_sync.h" #include "vm_callinfo.h" -#include "ractor.h" +#include "ractor_core.h" #include "builtin.h" diff --git a/include/ruby/ractor.h b/include/ruby/ractor.h new file mode 100644 index 0000000..6908c0a --- /dev/null +++ b/include/ruby/ractor.h @@ -0,0 +1,45 @@ https://github.com/ruby/ruby/blob/trunk/include/ruby/ractor.h#L1 +#ifndef RUBY_RACTOR_H +#define RUBY_RACTOR_H 1 + +/** + * @file + * @author Koichi Sasada + * @date Tue Nov 17 16:39:15 (... truncated) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/