summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authorPeter Zhu <[email protected]>2022-02-15 09:55:53 -0500
committerPeter Zhu <[email protected]>2022-02-16 09:50:29 -0500
commit71afa8164d40f18306fc2ee5a1ccc74f2926379b (patch)
treee3ac0dbc6c245f61a3cf98a7a999ba60c170847d /gc.c
parentf9abb286fb3ddff1caacea6c74d857803df18897 (diff)
Change darray size to size_t and add functions that use GC malloc
Changes size and capacity of darray to size_t to support more elements. Adds functions to darray that use GC allocation functions.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/5546
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gc.c b/gc.c
index 457f6457c7..35b9598c2a 100644
--- a/gc.c
+++ b/gc.c
@@ -12041,6 +12041,13 @@ rb_xmalloc_mul_add(size_t x, size_t y, size_t z) /* x * y + z */
}
void *
+rb_xcalloc_mul_add(size_t x, size_t y, size_t z) /* x * y + z */
+{
+ size_t w = size_mul_add_or_raise(x, y, z, rb_eArgError);
+ return ruby_xcalloc(w, 1);
+}
+
+void *
rb_xrealloc_mul_add(const void *p, size_t x, size_t y, size_t z) /* x * y + z */
{
size_t w = size_mul_add_or_raise(x, y, z, rb_eArgError);