diff options
author | Peter Zhu <[email protected]> | 2022-02-15 09:55:53 -0500 |
---|---|---|
committer | Peter Zhu <[email protected]> | 2022-02-16 09:50:29 -0500 |
commit | 71afa8164d40f18306fc2ee5a1ccc74f2926379b (patch) | |
tree | e3ac0dbc6c245f61a3cf98a7a999ba60c170847d /gc.c | |
parent | f9abb286fb3ddff1caacea6c74d857803df18897 (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.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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); |