summaryrefslogtreecommitdiff
path: root/darray.h
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2022-02-15 09:57:33 -0500
committerPeter Zhu <peter@peterzhu.ca>2022-02-16 09:50:29 -0500
commit969ad5802dfe60c254f2f30514233b05ece8049c (patch)
tree845ddf4da9c1472ff73f5c0ed7a27b704260ea17 /darray.h
parent71afa8164d40f18306fc2ee5a1ccc74f2926379b (diff)
downloadruby-969ad5802dfe60c254f2f30514233b05ece8049c.tar.gz
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.
Diffstat (limited to 'darray.h')
-rw-r--r--darray.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/darray.h b/darray.h
index 6c52b9b1f4..bb8199a98c 100644
--- a/darray.h
+++ b/darray.h
@@ -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.
//