summaryrefslogtreecommitdiff
path: root/internal.h
AgeCommit message (Collapse)Author
2019-08-18merge revision(s) ↵nagachika
f1b76ea63ce40670071a857f408a4747c571f1e9,1d1f98d49c9908f4e3928e582d31fd2e9f252f92: [Backport #16024] Occupy match data * string.c (rb_str_split_m): occupy match data not to be modified during yielding the block. [Bug #16024] Reuse match data * string.c (rb_str_split_m): reuse occupied match data. [Bug #16024] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_6@67743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-30merge revision(s) 66947: [Backport #15518]naruse
enumerator.c: fix arith_seq_first for Infinity * enumerator.c (arith_seq_first): fix for Float::INFINITY. * test/ruby/test_arithmetic_sequence.rb: add tests. * numeric.c (ruby_float_step_size): export for internal use. * internal.h: add prototype declaration of ruby_float_step_size. [ruby-core:90937][Bug #15518] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_6@66949 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-17merge revision(s) 66681,66682,66684,66688,66697,66751,66693,66694: [Backport ↵naruse
#15491] complex.c: Optimize Complex#+ for some conditions Optimize f_add defined in complex.c for some specific conditions. It makes Complex#+ about 1.4x faster than r66678. Compared to r66678: ``` mrkn-mbp15-late2016:complex-optim-o3 mrkn$ make benchmark ITEM=complex_float_ COMPARE_RUBY=/Users/mrkn/.rbenv/versions/trunk-o3/bin/ruby /Users/mrkn/src/github.com/ruby/ruby/revision.h unchanged /Users/mrkn/.rbenv/shims/ruby --disable=gems -rrubygems -I/Users/mrkn/src/github.com/ruby/ruby/benchmark/lib /Users/mrkn/src/github.com/ruby/ruby/benchmark/benchmark-driver/exe/benchmark-driver \ --executables="compare-ruby::/Users/mrkn/.rbenv/versions/trunk-o3/bin/ruby -I.ext/common --disable-gem" \ --executables="built-ruby::./miniruby -I/Users/mrkn/src/github.com/ruby/ruby/lib -I. -I.ext/common -r/Users/mrkn/src/github.com/ruby/ruby/prelude --disable-gem" \ $(find /Users/mrkn/src/github.com/ruby/ruby/benchmark -maxdepth 1 -name '*complex_float_*.yml' -o -name '*complex_float_*.rb' | sort) Calculating ------------------------------------- compare-ruby built-ruby complex_float_add 9.132M 12.864M i/s - 1.000M times in 0.109511s 0.077734s complex_float_div 600.723k 627.878k i/s - 1.000M times in 1.664662s 1.592666s complex_float_mul 2.320M 2.347M i/s - 1.000M times in 0.431039s 0.426113s complex_float_new 1.473M 1.489M i/s - 1.000M times in 0.678791s 0.671750s complex_float_power 1.690M 1.722M i/s - 1.000M times in 0.591863s 0.580775s complex_float_sub 8.870M 9.516M i/s - 1.000M times in 0.112740s 0.105091s Comparison: complex_float_add built-ruby: 12864383.7 i/s compare-ruby: 9131502.8 i/s - 1.41x slower complex_float_div built-ruby: 627878.0 i/s compare-ruby: 600722.5 i/s - 1.05x slower complex_float_mul built-ruby: 2346795.3 i/s compare-ruby: 2319975.7 i/s - 1.01x slower complex_float_new built-ruby: 1488649.1 i/s compare-ruby: 1473207.5 i/s - 1.01x slower complex_float_power built-ruby: 1721837.2 i/s compare-ruby: 1689580.2 i/s - 1.02x slower complex_float_sub built-ruby: 9515562.7 i/s compare-ruby: 8869966.3 i/s - 1.07x slower ``` suppress warning: method redefined; discarding old + introduced at r66681 complex.c: fix indentation complex.c: fix against redefining component methods This fixes the incompatibility (maybe unintentionally) introduced by removal of `#ifndef PRESERVE_SIGNEDZERO` guards in f_add, f_mul, and f_sub functions in r62701. [Bug #15491] [ruby-core:90843] complex.c: Optimize Complex#* and Complex#** Optimize f_mul for the core numeric class components. This change improves the computation time of Complex#* and Complex#**. ``` $ make benchmark ITEM=complex_float_ COMPARE_RUBY=/Users/mrkn/.rbenv/versions/2.6.0/bin/ruby generating known_errors.inc known_errors.inc unchanged /Users/mrkn/src/github.com/ruby/ruby/revision.h unchanged /Users/mrkn/.rbenv/shims/ruby --disable=gems -rrubygems -I/Users/mrkn/src/github.com/ruby/ruby/benchmark/lib /Users/mrkn/src/github.com/ruby/ruby/benchmark/benchmark-driver/exe/benchmark-driver \ --executables="compare-ruby::/Users/mrkn/.rbenv/versions/2.6.0/bin/ruby -I.ext/common --disable-gem" \ --executables="built-ruby::./miniruby -I/Users/mrkn/src/github.com/ruby/ruby/lib -I. -I.ext/common -r/Users/mrkn/src/github.com/ruby/ruby/prelude --disable-gem" \ $(find /Users/mrkn/src/github.com/ruby/ruby/benchmark -maxdepth 1 -name '*complex_float_*.yml' -o -name '*complex_float_*.rb' | sort) Calculating ------------------------------------- compare-ruby built-ruby complex_float_add 6.558M 13.012M i/s - 1.000M times in 0.152480s 0.076850s complex_float_div 576.821k 567.969k i/s - 1.000M times in 1.733640s 1.760660s complex_float_mul 1.690M 2.628M i/s - 1.000M times in 0.591786s 0.380579s complex_float_new 1.350M 1.268M i/s - 1.000M times in 0.740669s 0.788762s complex_float_power 1.571M 1.835M i/s - 1.000M times in 0.636507s 0.544909s complex_float_sub 8.635M 8.779M i/s - 1.000M times in 0.115814s 0.113906s Comparison: complex_float_add built-ruby: 13012361.7 i/s compare-ruby: 6558237.1 i/s - 1.98x slower complex_float_div compare-ruby: 576821.0 i/s built-ruby: 567968.8 i/s - 1.02x slower complex_float_mul built-ruby: 2627575.4 i/s compare-ruby: 1689800.0 i/s - 1.55x slower complex_float_new compare-ruby: 1350130.8 i/s built-ruby: 1267809.6 i/s - 1.06x slower complex_float_power built-ruby: 1835168.8 i/s compare-ruby: 1571074.6 i/s - 1.17x slower complex_float_sub built-ruby: 8779168.8 i/s compare-ruby: 8634534.7 i/s - 1.02x slower ``` complex.c: replace misused UNLIKELY with LIKELY test_complex.rb: fix tests for RUBYOPT="-w" test_complex.rb: use the same approach to fix failures as r66682. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_6@66854 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-21range.c: reject ArithmeticSequence in rb_range_valuesmrkn
Reject ArithmeticSequence in rb_range_values so that methods like Array#[] raises TypeError for ArithmeticSequence as an index. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66478 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-20hide iseq operand object for duphash. [Bug #15440]ko1
* compile.c (compile_array): hide source Hash object. * hash.c (rb_hash_resurrect): introduced to dup Hash object using rb_cHash. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-14rename li_table->ar_table (and related names).ko1
* internal.h: rename the following names: * li_table -> ar_table. "li" means linear (from linear search), but we use the word "array" (from data layout). * RHASH_ARRAY -> RHASH_AR_TABLE. AR_TABLE is more clear. * rb_hash_array_* -> rb_hash_ar_table_*. * RHASH_TABLE_P() -> RHASH_ST_TABLE_P(). more clear. * RHASH_CLEAR() -> RHASH_ST_CLEAR(). * hash.c: rename "linear_" prefix functions to "ar_" prefix. * hash.c (linear_init_table): rename to ar_alloc_table. * debug_counter.h: rename obj_hash_array to obj_hash_ar. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66390 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-12complex.c: new APIs for Complexnobu
[Feature #15066] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66360 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-12complex.c: rb_complex_new_polarnobu
* complex.c (rb_complex_new_polar): renamed with _new to clarify that it creates a new instance, but is not an instance method. * complex.c (rb_complex_polar): deprecated. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-12enumerator.c: rb_arithmetic_sequence_extractmrkn
New public C-API for extracting components of Enumerator::ArithmeticSequence or Range. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-06Add missing declaration to exportnaruse
Additional fix for r66200: https://rubyci.org/logs/rubyci.s3.amazonaws.com/icc-x64/ruby-trunk/log/20181206T130002Z.fail.html.gz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66254 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-06Should be true fix for r66200naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66247 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-06refix of r66200naruse
Though internal.h has the prototype, it still shows symbol lookup error... https://rubyci.org/logs/rubyci.s3.amazonaws.com/icc-x64/ruby-trunk/log/20181206T050002Z.fail.html.gz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66241 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-06fix r66200 againnaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66233 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-05Revert "fix typoe of r66200"normal
This reverts r66229 (commit e941daa6dd114b52356a63d3c3db5684e6c66717) Many CI failures on this: http://ci.rvm.jp/results/trunk-jemalloc@silicon-docker/1497858 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66231 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-05fix typoe of r66200naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66229 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-04Add prototype of rb_ary_ptr_use_start()naruse
Without this icc fails to run. http://rubyci.s3.amazonaws.com/icc-x64/ruby-trunk/log/20181203T130002Z.diff.html.gz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66200 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-03make `RARRAY_PTR_USE` more conservertive.ko1
* include/ruby/ruby.h: de-transient at `RARRAY_PTR_USE` and `RARRAY_PTR_USE_START`. Introduce `RARRAY_PTR_USE_TRANSIENT` and `RARRAY_PTR_USE_START_TRANSIENT` if you don't want to de-transient an array. Generally, it is difficult so C-extension writers should not use them. * array.c: use `RARRAY_PTR_USE_TRANSIENT` if possible. * hash.c: ditto. * enum.c (enum_sort_by): remove `rb_ary_transient_heap_evacuate()` because `RARRAY_PTR_USE` do de-transient. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66165 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-03process.c (rb_execarg_init): mark as staticnormal
io.c has not used it since r36229, and we can re-export it if we need it at another time. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66157 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-27Add rb_typeddata_is_instance_ofnobu
Similar to rb_typeddata_is_kind_of, except for that inherited type is not an instance. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66019 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-26process.c: avoid dlclose before execk0kubun
because JIT-ed code may still be on stack at this time, unlike in ruby_cleanup(). This hopes to fix: (take 2) http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/1480207 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65999 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-26Revert "process.c: try to workaroun SEGV by r65994"k0kubun
This reverts commit 0e6aba22c6b876a36adc39cac5314ce6e626954c. because it didn't help, at all. http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/1480207 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65998 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-26process.c: try to workaroun SEGV by r65994k0kubun
http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/1480173 It tries to print C backtrace but fails. And core file on the server seems to be stopping on the irrelevant place due to its own signal handler for the dump. And I failed to reproduce this SEGV on my machine. I don't know why it's broken, so let me try this change to investigate the reason of SEGV. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65997 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-26process.c: finish MJIT prior to #execk0kubun
to prevent ruby from leaving MJIT-related files. test_jit.rb: add a test to prevent that git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65994 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-19revert r65807k0kubun
it didn't work. http://ci.rvm.jp/results/trunk-mjit@silicon-docker/1468677 and skips broken tests for now. But this issue should be fixed soon. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65814 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-19internal.h: resurrect --disable-mjit-supportk0kubun
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65809 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-19process.c: do not run signal handler before forkk0kubun
to prevent from proceeding one for MJIT while it's not safe yet. By that situation, MJIT worker could be waiting for compiler process forever http://ci.rvm.jp/results/trunk-mjit@silicon-docker/1468033 [Bug #15320] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65807 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-12vm_insnhelper.c: avoid division by zeroshyouhei
same as r65642. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-07suppress GCC warning about unknown sanitizersshyouhei
See also: https://travis-ci.org/ruby/ruby/jobs/451710726#L1941 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65590 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-06workaround C++ism in ASAN header shyouhei
See also: https://travis-ci.org/ruby/ruby/jobs/451299690 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-06cont.c: direct use of rb_thread_tshyouhei
The only usage of rb_fiber_reset_root_local_storage() is from ruby_vm_destruct(), where the object space is already terminated. This `th->self` is not alive. Why not just use `th` itself. See also: https://travis-ci.org/ruby/ruby/jobs/451294954 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65574 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-06adopt sanitizer APIshyouhei
These APIs are much like <valgrind/memcheck.h>. Use them to fine-grain annotate the usage of our memory. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-06do not delete function declarations in case of non-sanitizing buildsshyouhei
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65565 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-06annotate functions to blacklist MSANshyouhei
In these functions we are intentionally reading memory address not owned by us. These reads should not be diagnosed. See also [Bug #8680] See also https://travis-ci.org/ruby/ruby/jobs/451202718 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65564 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-06Fixed compile error introduced at r65558usa
* internal.h (ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS): of course, parens around function signature in its definition is syntax error. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65560 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-06gc.c: move ASAN check to configureshyouhei
Availability of attributes are checked in configure these days, rather than compiler macros. Also __attribute__((no_address_safety_analysis)) is considered deprecated in both GCC and Clang. Use the current best practice if available. See also: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html https://clang.llvm.org/docs/AddressSanitizer.html git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-04complex.c: rb_dbl_complex_polar_pinobu
* complex.c (rb_dbl_complex_polar_pi): suffixed with _pi to clarify that `ang` is not radian, but multiplied by PI. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65522 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-03expose `rb_ary_detransient`.ko1
* internal.h: expose `rb_ary_detransient`. I'm not sure why there are no many troubles without this patch... git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65515 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-03internal.h: RHASH_ARRAY_SIZE_RAW value is unsignednobu
and get rid of warnings. [ruby-core:89688] [Bug #15279] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65512 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-01introduce USE_TRANSIENT_HEAP to enable/disable theap.ko1
* include/ruby/ruby.h: intrdocue `USE_TRANSIENT_HEAP` macro to enable/disable transient heap. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-30fix type.ko1
* internal.h (RHASH_ARRAY_SIZE_RAW): should be `int` because it returns n<=8. * hash.c (RHASH_ARRAY_BOUND_RAW): ditto. * hash.c (RHASH_ARRAY_SIZE_RAW): remove a duplicated definition. * hash.c (linear_keys, linear_values): return `long`. * hash.c (linear_keys): fix initialize expression of `key_end`. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65458 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-30* remove trailing spaces, expand tabs.svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-30support theap for T_HASH. [Feature #14989]ko1
* hash.c, internal.h: support theap for small Hash. Introduce RHASH_ARRAY (li_table) besides st_table and small Hash (<=8 entries) are managed by an array data structure. This array data can be managed by theap. If st_table is needed, then converting array data to st_table data. For st_table using code, we prepare "stlike" APIs which accepts hash value and are very similar to st_ APIs. This work is based on the GSoC achievement by tacinight <tacingiht@gmail.com> and refined by ko1. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65454 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-30support theap for T_STRUCT.ko1
* struct.c: members memory can use theap. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65452 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-30support theap for T_OBJECT.ko1
* variable.c: now instance variable space has theap supports. obj_ivar_heap_alloc() tries to acquire memory from theap. * debug_counter.h: add some counters for theap. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65451 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-30introduce TransientHeap. [Bug #14858]ko1
* transient_heap.c, transient_heap.h: implement TransientHeap (theap). theap is designed for Ruby's object system. theap is like Eden heap on generational GC terminology. theap allocation is very fast because it only needs to bump up pointer and deallocation is also fast because we don't do anything. However we need to evacuate (Copy GC terminology) if theap memory is long-lived. Evacuation logic is needed for each type. See [Bug #14858] for details. * array.c: Now, theap for T_ARRAY is supported. ary_heap_alloc() tries to allocate memory area from theap. If this trial sccesses, this array has theap ptr and RARRAY_TRANSIENT_FLAG is turned on. We don't need to free theap ptr. * ruby.h: RARRAY_CONST_PTR() returns malloc'ed memory area. It menas that if ary is allocated at theap, force evacuation to malloc'ed memory. It makes programs slow, but very compatible with current code because theap memory can be evacuated (theap memory will be recycled). If you want to get transient heap ptr, use RARRAY_CONST_PTR_TRANSIENT() instead of RARRAY_CONST_PTR(). If you can't understand when evacuation will occur, use RARRAY_CONST_PTR(). (re-commit of r65444) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65449 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-30revert r65444 and r65446 because of commit missko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-30support theap for T_OBJECT.ko1
* variable.c: now instance variable space has theap supports. obj_ivar_heap_alloc() tries to acquire memory from theap. * debug_counter.h: add some counters for theap. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65446 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-30introduce TransientHeap. [Bug #14858]ko1
* transient_heap.c, transient_heap.h: implement TransientHeap (theap). theap is designed for Ruby's object system. theap is like Eden heap on generational GC terminology. theap allocation is very fast because it only needs to bump up pointer and deallocation is also fast because we don't do anything. However we need to evacuate (Copy GC terminology) if theap memory is long-lived. Evacuation logic is needed for each type. See [Bug #14858] for details. * array.c: Now, theap for T_ARRAY is supported. ary_heap_alloc() tries to allocate memory area from theap. If this trial sccesses, this array has theap ptr and RARRAY_TRANSIENT_FLAG is turned on. We don't need to free theap ptr. * ruby.h: RARRAY_CONST_PTR() returns malloc'ed memory area. It menas that if ary is allocated at theap, force evacuation to malloc'ed memory. It makes programs slow, but very compatible with current code because theap memory can be evacuated (theap memory will be recycled). If you want to get transient heap ptr, use RARRAY_CONST_PTR_TRANSIENT() instead of RARRAY_CONST_PTR(). If you can't understand when evacuation will occur, use RARRAY_CONST_PTR(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65444 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-30process.c: implement rb_f_system without toggling ruby_nocldwaitnormal
Following how mjit_worker.c currently works, rb_f_system now ensures the VM-wide waitpid lists is locked before creating a new process via fork/vfork. This ensures other rb_waitpid callers cannot steal work and there are no possible race conditions from toggling ruby_nocldwait without the use of atomics. This sets us up for implementing MJIT process management logic using normal Ruby APIs prepares us for VM-wide asynchronous/event-base waitpid which can allow MJIT to work without worker threads. Take 2: set waitpid_state.pid on platforms w/o fork. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-30revert r65434normal
http://mswinci.japaneast.cloudapp.azure.com/vc12-x64/ruby-trunk/log/20181030T003541Z.fail.html.gz I have no chance of getting anything to work on proprietary platforms :< git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65436 b2dd03c8-39d4-4d8f-98ff-823fe69b080e