summaryrefslogtreecommitdiff
path: root/array.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-12-20 08:33:17 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-12-20 08:33:17 +0000
commitbc49bc7c6b6a16d725cd1279e9021465b1307f3d (patch)
tree023b7da77738e7e049de5002eade542b7f17e930 /array.c
parentb702ab5d6cf585ac0ff0cad3cd5aebbc40e82de0 (diff)
* parse.y (do_block): split "do" block and tLBRACE_ARG block.
* parse.y (cmd_brace_block): new tLBRACE_ARG block rule * parse.y (command): can take optional cmd_brace_block; use %prec to resolve shift/reduce conflict. (ruby-bugs-ja PR#372) * eval.c (ruby_finalize): trace_func should be cleared here (after executing exit procs and finalizers). * eval.c (rb_define_alloc_func): new allocation framework, based on Nobu's work [ruby-dev:19116]. "allocate" method is no longer used for object allocation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3188 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'array.c')
-rw-r--r--array.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/array.c b/array.c
index 927d4dc..9c880e0 100644
--- a/array.c
+++ b/array.c
@@ -87,7 +87,7 @@ rb_ary_frozen_p(ary)
}
static VALUE
-rb_ary_s_alloc(klass)
+ary_alloc(klass)
VALUE klass;
{
NEWOBJ(ary, struct RArray);
@@ -105,7 +105,7 @@ ary_new(klass, len)
VALUE klass;
long len;
{
- VALUE ary = rb_obj_alloc(klass);
+ VALUE ary = ary_alloc(klass);
if (len < 0) {
rb_raise(rb_eArgError, "negative array size (or size too big)");
@@ -275,7 +275,7 @@ rb_ary_s_create(argc, argv, klass)
VALUE *argv;
VALUE klass;
{
- VALUE ary = rb_obj_alloc(klass);
+ VALUE ary = ary_alloc(klass);
if (argc < 0) {
rb_raise(rb_eArgError, "negative number of arguments");
@@ -480,7 +480,7 @@ rb_ary_subseq(ary, beg, len)
if (len == 0) return ary_new(klass, 0);
ary_make_shared(ary);
- ary2 = rb_obj_alloc(klass);
+ ary2 = ary_alloc(klass);
RARRAY(ary2)->ptr = RARRAY(ary)->ptr + beg;
RARRAY(ary2)->len = len;
RARRAY(ary2)->aux.shared = RARRAY(ary)->aux.shared;
@@ -1872,7 +1872,7 @@ Init_Array()
rb_cArray = rb_define_class("Array", rb_cObject);
rb_include_module(rb_cArray, rb_mEnumerable);
- rb_define_singleton_method(rb_cArray, "allocate", rb_ary_s_alloc, 0);
+ rb_define_alloc_func(rb_cArray, ary_alloc);
rb_define_singleton_method(rb_cArray, "[]", rb_ary_s_create, -1);
rb_define_method(rb_cArray, "initialize", rb_ary_initialize, -1);
rb_define_method(rb_cArray, "to_s", rb_ary_to_s, 0);