1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Change feature_index from fake Array to darray

Using a fake (malloc) RArray is not friendly for the garbage
collector. Fake RArray does not have a heap page, so it causes Variable
Width Allocation to crash when we try to implement it on Arrays.

This commit changes feature_index from a RArray to a darray.
This commit is contained in:
Peter Zhu 2022-02-15 09:57:33 -05:00
parent 71afa8164d
commit 969ad5802d
Notes: git 2022-02-16 23:50:49 +09:00
2 changed files with 89 additions and 55 deletions

View file

@ -104,6 +104,8 @@
rb_darray_make_impl((ptr_to_ary), size, sizeof(**(ptr_to_ary)), \
sizeof((*(ptr_to_ary))->data[0]), ruby_xcalloc)
#define rb_darray_data_ptr(ary) ((ary)->data)
// Set the size of the array to zero without freeing the backing memory.
// Allows reusing the same array.
//