зеркало из https://github.com/github/ruby.git
Remove check for shared root arrays
All shared root arrays should not be on the transient heap. ary_make_shared evacuates arrays from the transient heap when creating shared roots.
This commit is contained in:
Родитель
f0ae583a3d
Коммит
9d862011e8
6
array.c
6
array.c
|
@ -452,15 +452,13 @@ static inline void
|
||||||
rb_ary_transient_heap_evacuate_(VALUE ary, int transient, int promote)
|
rb_ary_transient_heap_evacuate_(VALUE ary, int transient, int promote)
|
||||||
{
|
{
|
||||||
if (transient) {
|
if (transient) {
|
||||||
|
assert(!ARY_SHARED_ROOT_P(ary));
|
||||||
|
|
||||||
VALUE *new_ptr;
|
VALUE *new_ptr;
|
||||||
const VALUE *old_ptr = ARY_HEAP_PTR(ary);
|
const VALUE *old_ptr = ARY_HEAP_PTR(ary);
|
||||||
long capa = ARY_HEAP_CAPA(ary);
|
long capa = ARY_HEAP_CAPA(ary);
|
||||||
long len = ARY_HEAP_LEN(ary);
|
long len = ARY_HEAP_LEN(ary);
|
||||||
|
|
||||||
if (ARY_SHARED_ROOT_P(ary)) {
|
|
||||||
capa = len;
|
|
||||||
}
|
|
||||||
|
|
||||||
assert(ARY_OWNS_HEAP_P(ary));
|
assert(ARY_OWNS_HEAP_P(ary));
|
||||||
assert(RARRAY_TRANSIENT_P(ary));
|
assert(RARRAY_TRANSIENT_P(ary));
|
||||||
assert(!ARY_PTR_USING_P(ary));
|
assert(!ARY_PTR_USING_P(ary));
|
||||||
|
|
Загрузка…
Ссылка в новой задаче