* test/test_find.rb (test_to_path): add a test
for to_path conversion.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60067 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string.c (str_succ): clear coderange cache when no alpha-numeric
character case, carried part may become ASCII-only.
[ruby-core:83062] [Bug #13952]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60066 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* template/sizes.c.tmpl (Init_limits): turned a K&R style
declaration into a prototype declaration.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60065 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/etc/test_etc.rb: Etc.getgrnam would not return the first entry in the order of Etc.group for duplicated group names.
follow-up: [Bug #6935]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60063 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* pack.c (pack_unpack_internal): set ASCII only properly on "M",
may be ASCII only. [ruby-core:83055] [Bug #13949]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60059 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
[Feature #13884]
Reduce number of memory allocations for "and", "or" and "diff"
operations on small arrays
Very often, arrays are used to filter parameters and to select
interesting items from 2 collections and very often these
collections are small enough, for example:
```ruby
SAFE_COLUMNS = [:id, :title, :created_at]
def columns
@all_columns & SAFE_COLUMNS
end
```
In this patch, I got rid of unnecessary memory allocations for
small arrays when "and", "or" and "diff" operations are performed.
name | HEAD | PATCH
-----------------+------:+------:
array_small_and | 0.615 | 0.263
array_small_diff | 0.676 | 0.282
array_small_or | 0.953 | 0.463
name | PATCH
-----------------+------:
array_small_and | 2.343
array_small_diff | 2.392
array_small_or | 2.056
name | HEAD | PATCH
-----------------+------:+------:
array_small_and | 1.429 | 1.005
array_small_diff | 1.493 | 0.878
array_small_or | 1.672 | 1.152
name | PATCH
-----------------+------:
array_small_and | 1.422
array_small_diff | 1.700
array_small_or | 1.452
Author: Dmitry Bochkarev <dimabochkarev@gmail.com>
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60057 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/-ext-/win32/test_dln.rb (TestDln#test_check_imported):
RbConfig::CONFIG["PATH_SEPARATOR"] is : which is a separator on
msys2 shell building ruby. Use File::PATH_SEPARATOR ; on test.
[Bug #13642] [ruby-core:81623]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60056 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io.c (fptr_finalize_flush): add an argument to keep GVL.
* io.c (fptr_finalize): adjust for above change.
* io.c (io_close_fptr): closing without GVL causes another
exception while raising exception in another thread. This causes
segfault on Windows. Keep GVL while closing when another thread
raises.
[Bug #13856] [ruby-core:82602]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60055 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/io/console/test_io_console.rb: flush to ensure the second
data is sent.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60049 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* complex.c (rb_complex_infinite_p): get rid of overflow and
unnecessary multiplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60041 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* complex.c (rb_complex_finite_p): get rid of overflow and
unnecessary multiplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60040 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This seems to be unreachable from first introduction at r21286.
In ERB implementation, `#empty?` is only called for each member of
return value of `String#scan`, and `ERB::Compiler::PercentLine` is never
returned from `String#scan`.
Also, in `ERB::Compiler#compile`, as it's yielded only when stag is nil,
methods called to `ERB::Compiler::PercentLine` object yielded from
`ERB::Compiler::TrimScanner#scan` are only: `#nil?`, `#==`, `to_s`.
Thus `ERB::Compiler::PercentLine#empty?` is never used.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60032 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
At the moment rb_stat function is blocking. This patch changes the
behaviour to release the gvl while waiting for OS to return from
f(stat).
There is behaviour impact, but not significant (times are for 100000
iterations):
$ ~/releaseruby_patch/bin/ruby bench.rb
Rehearsal ------------------------------------------------
File.exist?: 0.036412 0.056616 0.093028 ( 0.093075)
--------------------------------------- total: 0.093028sec
user system total real
File.exist?: 0.042953 0.049783 0.092736 ( 0.092804)
$ ~/releaseruby_no_patch/bin/ruby bench.rb
Rehearsal ------------------------------------------------
File.exist?: 0.056094 0.026293 0.082387 ( 0.082389)
--------------------------------------- total: 0.082387sec
user system total real
File.exist?: 0.037250 0.046702 0.083952 ( 0.083956)
Based on the patch by Wolf <wolf@wolfsden.cz> at [ruby-core:83012],
with using `rb_thread_io_blocking_region` for `fstat`.
[Bug #13941]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60027 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/drb/test_drb.rb (TestDRbLarge#test_02_large_ary): removed
unnecessary extra spaces which make the following parentheses an
expression.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60026 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm.c (rb_vm_jump_tag_but_local_jump): no longer used since
r51292.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60025 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm.c (rb_vm_make_jump_tag_but_local_jump): get rid of fetching
retval when it is not used. it is necessary for local jump
state only.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60024 b2dd03c8-39d4-4d8f-98ff-823fe69b080e