Before this patch, if `reject!` is called on a shared array it can
mutate the shared array rather than a copy. This patch marks the array
as "going to be modified" so that the shared source array isn't
mutated.
[Bug #15479] [ruby-core:90781]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66756 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* eval_error.c (print_errinfo): defer escaping control char in
error messages until writing to stderr, instead of quoting at
building the message. [ruby-core:90853] [Bug #15497]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66753 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Do not use the optimized version of Range#last when Range#each is
redefined.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66749 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Cannonicalize resultant real and imaginary parts when complex number
divided by non-complex number.
[Fix GH-2065] [Bug #15505] [ruby-core:90891]
From: Joe Peric <peric.joe@gmail.com>
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
because we had another one in missing/stdbool.h as well.
Assuming that _Bool does not exist when stdbool.h is absent, I'm in
favor of r57462 implementation rather than r61326.
Note that Visual Studio 2013 has stdbool.h and thus r57462's commit
message is somewhat misleading. This missing/stdbool.h is for Visual
Studio 2012 or older, and for Oracle Solaris Studio 12.2 or older because
it's added in 12.3 https://docs.oracle.com/cd/E24457_01/html/E21987/gkeza.html.
missing/stdbool.h: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66739 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
In downloader.rb, add logic to handle file names of the form
UnicodeData-12.0.0d6.txt. To find the right file, we download
the index of the directory. Then we download the files by finding
the file names from the index. Files are always checked for changes,
because changes might be frequent during the beta period.
We also check whether any index.html files are left when we are not
in the beta period. This would indicate that we might have stale
data from the beta period rather than the actual release data.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66737 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This change improves the performance of Range#last method for a range
of integer. This optimization directly computes only required values
only in a range instead of converting all values in the range to an
array. The optimized implementation is 129-16.7k times faster than
the previous one in the benchmark result given below.
=== Benchmark Result ===
```
$ make benchmark ITEM=range_last 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 '*range_last*.yml' -o -name '*range_last*.rb' | sort)
Warming up --------------------------------------
(1..1_000_000).last(100) 35.600 i/s - 36.000 times in 1.011239s (28.09ms/i)
(1..1_000_000).last(1000) 36.204 i/s - 39.000 times in 1.077240s (27.62ms/i)
(1..1_000_000).last(10000) 36.470 i/s - 39.000 times in 1.069386s (27.42ms/i)
Calculating -------------------------------------
compare-ruby built-ruby
(1..1_000_000).last(100) 36.477 609.196k i/s - 106.000 times in 2.905950s 0.000174s
(1..1_000_000).last(1000) 35.936 50.350k i/s - 108.000 times in 3.005321s 0.002145s
(1..1_000_000).last(10000) 35.641 4.602k i/s - 109.000 times in 3.058233s 0.023685s
Comparison:
(1..1_000_000).last(100)
built-ruby: 609195.7 i/s
compare-ruby: 36.5 i/s - 16700.87x slower
(1..1_000_000).last(1000)
built-ruby: 50349.7 i/s
compare-ruby: 35.9 i/s - 1401.08x slower
(1..1_000_000).last(10000)
built-ruby: 4602.1 i/s
compare-ruby: 35.6 i/s - 129.12x slower
```
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Add assertions of Range#first and Range#last to examine the type
conversion of the arguments and the negative value check.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66726 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (symbol): turned into a node, as well as `numeric`, for
a symbol literal, and includes `dsym` now.
* parse.y (ssym): previous `symbol`. renamed as the counterpart
of `dsym`.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66724 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: refine error messages for tSYMBEG and tSTRING_BEG, which
can appear at invalid places.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66722 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Separate downloading of Unicode property files in ucd and in ucd/auxiliary.
This is needed because we need information from separate index.html files
to discover the exact file names of property files during a beta period.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66720 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* hash.c: ar_table only supports `objhash` so we can call compare/hash
functions directly.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66718 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* hash.c (hash_stlike_lookup): introduce inline a function and use it
instead of using ar_lookup()/st_lookup() directly.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66717 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
as well. Follows up r66598.
https://bugs.ruby-lang.org/issues/15347#note-7 is saying __restrict
is supported on Visual Studio 2013.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66715 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
zlib and bignum both contain unblocking functions which are
async-signal-safe and do not require spawning additional
threads.
We can execute those functions directly in signal handlers
without incurring overhead of extra threads, so provide C-API
users the ability to deal with that. Other C-API users may
have similar need.
This flexible API can supercede existing uses of
rb_thread_call_without_gvl and rb_thread_call_without_gvl2 by
introducing a flags argument to control behavior.
Note: this API is NOT finalized. It needs approval from other
committers. I prefer shorter name than previous
rb_thread_call_without_gvl* functions because my eyes requires
big fonts.
[Bug #15499]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66712 b2dd03c8-39d4-4d8f-98ff-823fe69b080e