summaryrefslogtreecommitdiff
path: root/array.c
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2022-07-21 15:16:06 -0400
committerPeter Zhu <peter@peterzhu.ca>2022-07-21 15:17:59 -0400
commit9d862011e82b04bf21b26ebe4b472e8ef801dfef (patch)
tree76e21c533935078500fea1e96fa507684e80d856 /array.c
parentf0ae583a3d64d3a9d94a193cb999d87b32c8b87b (diff)
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.
Diffstat (limited to 'array.c')
-rw-r--r--array.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/array.c b/array.c
index 54d928a992..c0b49340c6 100644
--- a/array.c
+++ b/array.c
@@ -452,15 +452,13 @@ static inline void
rb_ary_transient_heap_evacuate_(VALUE ary, int transient, int promote)
{
if (transient) {
+ assert(!ARY_SHARED_ROOT_P(ary));
+
VALUE *new_ptr;
const VALUE *old_ptr = ARY_HEAP_PTR(ary);
long capa = ARY_HEAP_CAPA(ary);
long len = ARY_HEAP_LEN(ary);
- if (ARY_SHARED_ROOT_P(ary)) {
- capa = len;
- }
-
assert(ARY_OWNS_HEAP_P(ary));
assert(RARRAY_TRANSIENT_P(ary));
assert(!ARY_PTR_USING_P(ary));