Age | Commit message (Collapse) | Author |
|
* Fix Array#[] with ArithmeticSequence with negative steps
Previously, Array#[] when called with an ArithmeticSequence
with a negative step did not handle all cases correctly,
especially cases involving infinite ranges, inverted ranges,
and/or exclusive ends.
Fixes [Bug #18247]
* Add Array#slice tests for ArithmeticSequence with negative step to test_array
Add tests of rb_arithmetic_sequence_beg_len_step C-API function.
* Fix ext/-test-/arith_seq/beg_len_step/depend
* Rename local variables
* Fix a variable name
Co-authored-by: Kenta Murata <[email protected]>
Notes:
Merged-By: mrkn <[email protected]>
|
|
Before this commit, if the slice fits in VWA, it would make a copy
rather than a view. This is slower as it requires a memcpy of the
contents.
Notes:
Merged: https://github.com/ruby/ruby/pull/6192
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/6180
|
|
rb_ary_tmp_new suggests that the array is temporary in some way, but
that's not true, it just creates an array that's hidden and not on the
transient heap. This commit renames it to rb_ary_hidden_new.
Notes:
Merged: https://github.com/ruby/ruby/pull/6180
|
|
ary_discard should not be used as it should be handled by the GC. The
only user of ary_discard is rb_ary_product, which doesn't neeed to use
ary_discard.
Notes:
Merged: https://github.com/ruby/ruby/pull/6180
|
|
The RARRAY_LITERAL_FLAG was added in commit
5871ecf956711fcacad7c03f2aef95115ed25bc4 to improve CoW performance for
array literals by not keeping track of reference counts.
This commit reverts that commit and has an alternate implementation that
is more generic for all frozen arrays. Since frozen arrays cannot be
modified, we don't need to set the RARRAY_SHARED_ROOT_FLAG and we don't
need to do reference counting.
Notes:
Merged: https://github.com/ruby/ruby/pull/6171
|
|
array.c:460:14: warning: unused variable 'len' [-Wunused-variable]
long len = ARY_HEAP_LEN(ary);
|
|
All shared root arrays should not be on the transient heap.
ary_make_shared evacuates arrays from the transient heap when creating
shared roots.
|
|
[Misc #18891]
Notes:
Merged: https://github.com/ruby/ruby/pull/6094
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/6157
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/6157
|
|
Move some macros in array.c to internal/array.h so that other files
can also access these macros.
Notes:
Merged: https://github.com/ruby/ruby/pull/6157
|
|
Array created as literals during iseq compilation don't need a
reference count since they can never be modified. The previous
implementation would mutate the hidden array's reference count,
causing copy-on-write invalidation.
This commit adds a RARRAY_LITERAL_FLAG for arrays created through
rb_ary_literal_new. Arrays created with this flag do not have reference
count stored and just assume they have infinite number of references.
Co-authored-by: Jean Boussier <[email protected]>
Notes:
Merged: https://github.com/ruby/ruby/pull/6151
|
|
vshared is no longer used.
|
|
This commit enables Arrays to move between size pools during compaction.
This can occur if the array is mutated such that it would fit in a
different size pool when embedded.
The move is carried out in two stages:
1. The RVALUE is moved to a destination heap during object movement
phase of compaction
2. The array data is re-embedded and the original buffer free'd if
required. This happens during the update references step
Notes:
Merged: https://github.com/ruby/ruby/pull/6099
|
|
Previously it made object references without using write barriers,
creating GC inconsistencies.
See: http://ci.rvm.jp/results/trunk-gc-asserts@phosphorus-docker/3925529
Notes:
Merged: https://github.com/ruby/ruby/pull/5851
|
|
Notes:
Merged-By: BurdetteLamar <[email protected]>
|
|
This covers the first few sections of the class doc for Array.
Notes:
Merged-By: BurdetteLamar <[email protected]>
|
|
Method references is not only able to be marked up as code, also
reflects `--show-hash` option.
The bug that prevented the old rdoc from correctly parsing these
methods was fixed last month.
|
|
Notes:
Merged-By: BurdetteLamar <[email protected]>
|
|
* Repair format and links in What's Here for Comparable and Array
* Repair format for What's Here in enum.c
Notes:
Merged-By: BurdetteLamar <[email protected]>
|
|
This commit implements arrays on Variable Width Allocation. This allows
longer arrays to be embedded (i.e. contents directly follow the object
header) which improves performance through better cache locality.
Notes:
Merged: https://github.com/ruby/ruby/pull/5660
|
|
The refcnt of a shared root array should always be non-negative.
|
|
All callers of rb_ary_decrement_share guarantee that
shared_root is not 0.
|
|
rb_ary_reset could leave the array in a bad state since it frees memory
but does not unset any flags. This can cause a crash on GC stress. This
commit changes rb_ary_reset to set the array as an empty embedded array.
|
|
rb_ary_reset will free heap allocated arrays and unshare shared arrays.
|
|
In both cases in the if statement, we free heap allocated arrays and
unshare shared arrays.
|
|
rb_ary_unshare will perform FL_UNSET_SHARED and
rb_ary_decrement_share.
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/5621
|
|
Never returns self.
Notes:
Merged: https://github.com/ruby/ruby/pull/5605
Merged-By: nobu <[email protected]>
|
|
rb_ary_shift is just a special case of rb_ary_behead where we behead
only 1 element.
Notes:
Merged: https://github.com/ruby/ruby/pull/5590
|
|
RARRAY_SHARED_ROOT_FLAG is defined as FL_USER5, but we should use
RARRAY_SHARED_ROOT_FLAG instead of depending on that they're equal.
Notes:
Merged: https://github.com/ruby/ruby/pull/5547
|
|
|
|
Mostly suppressing links to itself.
Notes:
Merged-By: BurdetteLamar <[email protected]>
|
|
|
|
|
|
I used this regex:
(?<=\[)#(?:class|module)-([A-Za-z]+)-label-([A-Za-z0-9\-\+]+)
And performed a global find & replace for this:
rdoc-ref:$1@$2
Notes:
Merged: https://github.com/ruby/ruby/pull/5530
|
|
I used this regex:
([A-Za-z]+)\.html#(?:class|module)-[A-Za-z]+-label-([A-Za-z0-9\-\+]+)
And performed a global find & replace for this:
rdoc-ref:$1@$2
Notes:
Merged: https://github.com/ruby/ruby/pull/5530
|
|
* Adding links to literals and Kernel
Notes:
Merged-By: BurdetteLamar <[email protected]>
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/5112
|
|
This commit removes usages of rb_gc_force_recycle since it is a burden
to maintain and makes changes to the GC difficult.
Notes:
Merged: https://github.com/ruby/ruby/pull/4363
|
|
Notes:
Merged-By: k0kubun <[email protected]>
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/4925
Merged-By: nobu <[email protected]>
|
|
* As the "doc/" prefix is specified by the `--page-dir` option,
remove from the rdoc references.
* Refer to the original .rdoc instead of the converted .html.
|
|
This PR creates doc/bsearch.rdoc to provide common documentation for bsearch in Array and Range.
Notes:
Merged-By: BurdetteLamar <[email protected]>
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/4805
|
|
Must not be a bad idea to improve documents. [ci skip]
Notes:
Merged: https://github.com/ruby/ruby/pull/4815
|
|
This prevents early collection of the array. The GC doesn't see the
array on the stack when Ruby is compiled with optimizations enabled
[ruby-core:105099] [Bug #18140]
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/4463
|
|
Commit 4f24255 introduced a bug which allows a length to be passed to
rb_ary_new4 which is too large, resulting in invalid memory access.
For example:
(1..1000).to_a.slice!(-2, 1000)
Notes:
Merged: https://github.com/ruby/ruby/pull/4787
|