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

* array.c (rb_ary_resize): new utility function. [ruby-dev:42912]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30465 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2011-01-05 20:10:59 +00:00
parent 697a45b196
commit c8aaf31fdd
5 changed files with 90 additions and 0 deletions

View file

@ -0,0 +1 @@
create_makefile("-test-/array/resize")

View file

@ -0,0 +1,14 @@
#include "ruby/ruby.h"
static VALUE
ary_resize(VALUE ary, VALUE len)
{
rb_ary_resize(ary, NUM2LONG(len));
return ary;
}
void
Init_resize(void)
{
rb_define_method(rb_cArray, "resize", ary_resize, 1);
}