| Age | Commit message (Collapse) | Author |
|
* Document Range#to_set
* Update Thread#raise and Fiber#raise signatures and docs
* Add reference to String#strip to character_selectors.rdoc
* Update *nil docs when calling methods
* Enhance Array#find and #rfind docs
* Add a notice to Kernel#raise about cause:
|
|
|
|
Otherwise Array#detect is Enumerable#detect while Array#find uses a
different more performant implementation.
[Feature #21678]
|
|
Implement Array#rfind, which is the same as find except from the
other side of the Array. Also implemented Array#find (as opposed to
the generic one on Enumerable because it is significantly faster
and to keep the implementations together.
[Feature #21678]
|
|
When all elements are strings, we never have to recalculate the length
of the array because there are no conversion methods that are called, so
the length will never change. This speeds up the fast path by ~10%.
```ruby
a = ["1"*10, "2"*10, "3"*10, "4"*10, "5"*10] * 10
10_000_000.times do
a.join
end
```
```
hyperfine --warmup 1 'ruby ../ruby2/test.rb' './exe/ruby ../ruby2/test.rb'
Benchmark 1: ruby ../ruby2/test.rb
Time (mean ± σ): 3.779 s ± 0.053 s [User: 3.754 s, System: 0.017 s]
Range (min … max): 3.715 s … 3.874 s 10 runs
Benchmark 2: ./exe/ruby ../ruby2/test.rb
Time (mean ± σ): 3.411 s ± 0.038 s [User: 3.387 s, System: 0.017 s]
Range (min … max): 3.360 s … 3.472 s 10 runs
Summary
./exe/ruby ../ruby2/test.rb ran
1.11 ± 0.02 times faster than ruby ../ruby2/test.rb
```
|
|
|
|
Re-organize page docs
|
|
We need to allocate at least sizeof(struct RArray) when the array is
embedded on garbage collectors that support slot sizes less than 40 bytes.
|
|
to adopt strict shareable rule.
* (basically) shareable objects only refer shareable objects
* (exception) shareable objects can refere unshareable objects
but should not leak reference to unshareable objects to Ruby world
|
|
Duplicate the was found in the documentation
|
|
|
|
We should access the last element first before we shrink the length of the
array.
|
|
|
|
doc currently indicates the return value as `new_array` but then in the first sentence explains "always returns +self+ (never a new array)".
|
|
The `FL_FREEZE` flag is redundant with `SHAPE_ID_FL_FROZEN`, so
ideally it should be eliminated in favor of the later.
Doing so would eliminate the risk of desync between the two, but
also solve the problem of the frozen status being global in namespace
context (See Bug #21330).
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/13296
|
|
The receiver can be modified during the method calls.
Notes:
Merged: https://github.com/ruby/ruby/pull/13255
Merged-By: nobu <nobu@ruby-lang.org>
|
|
[Bug #21303]
Notes:
Merged: https://github.com/ruby/ruby/pull/13249
|
|
[Feature #20877]
Notes:
Merged: https://github.com/ruby/ruby/pull/11975
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12820
|
|
`Array#sort!` does that check, but `#sort_by!` always tries to
sort, which is wasteful.
Notes:
Merged: https://github.com/ruby/ruby/pull/12741
|
|
The documentation guide (https://docs.ruby-lang.org/en/master/contributing/documentation_guide_md.html#label-Calling+Sequence+-28for+methods+written+in+C-29)
says that the call-seq for instance methods should only include the method
name, no prepending `array.`.
Notes:
Merged: https://github.com/ruby/ruby/pull/12728
|
|
When only one element remains, this simply swaps the first identical
element and has no actual effect.
Notes:
Merged: https://github.com/ruby/ruby/pull/12690
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12498
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12496
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12496
|
|
The inspect format was intentionally changed as an outcome of
[Bug #20433] [ruby-core:118668], but some documentation update
was missing, as [Bug #20962] pointed out. Update some output
examples that clearly use Hash#inspect.
Notes:
Merged: https://github.com/ruby/ruby/pull/12384
Merged-By: XrXr
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12316
|
|
Notes:
Merged-By: peterzhu2118 <peter@peterzhu.ca>
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12344
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12266
|
|
When setting len to X we only need to grow the array
if len is bigger than capa. If they're equal we don't need to
increase capacity.
Notes:
Merged: https://github.com/ruby/ruby/pull/12262
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12229
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12113
|
|
Co-Authored-By: Aaron Patterson <tenderlove@ruby-lang.org>
Notes:
Merged: https://github.com/ruby/ruby/pull/12074
|
|
* Use FL_USER0 for ELTS_SHARED
This makes space in RString for two bits for chilled strings.
* Mark strings returned by `Symbol#to_s` as chilled
[Feature #20350]
`STR_CHILLED` now spans on two user flags. If one bit is set it
marks a chilled string literal, if it's the other it marks a
`Symbol#to_s` chilled string.
Since it's not possible, and doesn't make much sense to include
debug info when `--debug-frozen-string-literal` is set, we can't
include allocation source, but we can safely include the symbol
name in the warning message, making it much easier to find the source
of the issue.
Co-Authored-By: Étienne Barrié <etienne.barrie@gmail.com>
---------
Co-authored-by: Étienne Barrié <etienne.barrie@gmail.com>
Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12044
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12039
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12038
|
|
Notes:
Merged-By: peterzhu2118 <peter@peterzhu.ca>
|
|
Notes:
Merged-By: peterzhu2118 <peter@peterzhu.ca>
|
|
* YJIT: Replace Array#each only when YJIT is enabled
* Add comments about BUILTIN_ATTR_C_TRACE
* Make Ruby Array#each available with --yjit as well
* Fix all paths that expect a C location
* Use method_basic_definition_p to detect patches
* Copy a comment about C_TRACE flag to compilers
* Rephrase a comment about add_yjit_hook
* Give METHOD_ENTRY_BASIC flag to Array#each
* Add --yjit-c-builtin option
* Allow inconsistent source_location in test-spec
* Refactor a check of BUILTIN_ATTR_C_TRACE
* Set METHOD_ENTRY_BASIC without touching vm->running
Notes:
Merged-By: maximecb <maximecb@ruby-lang.org>
|
|
Notes:
Merged-By: peterzhu2118 <peter@peterzhu.ca>
|
|
Notes:
Merged-By: peterzhu2118 <peter@peterzhu.ca>
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11937
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11936
|
|
Notes:
Merged-By: peterzhu2118 <peter@peterzhu.ca>
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11934
|
|
Notes:
Merged-By: peterzhu2118 <peter@peterzhu.ca>
|
|
Notes:
Merged-By: peterzhu2118 <peter@peterzhu.ca>
|