diff options
Diffstat (limited to 'ext/-test-')
-rw-r--r-- | ext/-test-/array/resize/extconf.rb | 1 | ||||
-rw-r--r-- | ext/-test-/array/resize/resize.c | 14 |
2 files changed, 15 insertions, 0 deletions
diff --git a/ext/-test-/array/resize/extconf.rb b/ext/-test-/array/resize/extconf.rb new file mode 100644 index 0000000000..6500a878fc --- /dev/null +++ b/ext/-test-/array/resize/extconf.rb @@ -0,0 +1 @@ +create_makefile("-test-/array/resize") diff --git a/ext/-test-/array/resize/resize.c b/ext/-test-/array/resize/resize.c new file mode 100644 index 0000000000..b3e6c751ba --- /dev/null +++ b/ext/-test-/array/resize/resize.c @@ -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); +} |