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:
parent
697a45b196
commit
c8aaf31fdd
5 changed files with 90 additions and 0 deletions
1
ext/-test-/array/resize/extconf.rb
Normal file
1
ext/-test-/array/resize/extconf.rb
Normal file
|
@ -0,0 +1 @@
|
|||
create_makefile("-test-/array/resize")
|
14
ext/-test-/array/resize/resize.c
Normal file
14
ext/-test-/array/resize/resize.c
Normal 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);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue