ruby-changes:28947
From: nobu <ko1@a...>
Date: Fri, 31 May 2013 17:05:08 +0900 (JST)
Subject: [ruby-changes:28947] nobu:r40999 (trunk): array.c: new names of rb_ary_new family
nobu 2013-05-31 17:04:56 +0900 (Fri, 31 May 2013) New Revision: 40999 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=40999 Log: array.c: new names of rb_ary_new family * array.c (rb_ary_new_capa): add better names of rb_ary_new2. * array.c (rb_ary_new_from_args): ditto for rb_ary_new3. * array.c (rb_ary_new_from_values): ditto for rb_ary_new4. Modified files: trunk/ChangeLog trunk/README.EXT trunk/array.c trunk/include/ruby/intern.h Index: README.EXT =================================================================== --- README.EXT (revision 40998) +++ README.EXT (revision 40999) @@ -250,15 +250,18 @@ rb_ary_new() :: https://github.com/ruby/ruby/blob/trunk/README.EXT#L250 Creates an array with no elements. rb_ary_new2(long len) :: +rb_ary_new_capa(long len) :: Creates an array with no elements, allocating internal buffer for len elements. rb_ary_new3(long n, ...) :: +rb_ary_new_from_args(long n, ...) :: Creates an n-element array from the arguments. rb_ary_new4(long n, VALUE *elts) :: +rb_ary_new_from_values(long n, VALUE *elts) :: Creates an n-element array from a C array. Index: array.c =================================================================== --- array.c (revision 40998) +++ array.c (revision 40999) @@ -425,22 +425,19 @@ ary_new(VALUE klass, long capa) https://github.com/ruby/ruby/blob/trunk/array.c#L425 } VALUE -rb_ary_new2(long capa) +rb_ary_new_capa(long capa) { return ary_new(rb_cArray, capa); } - VALUE rb_ary_new(void) { return rb_ary_new2(RARRAY_EMBED_LEN_MAX); } -#include <stdarg.h> - VALUE -rb_ary_new3(long n, ...) +rb_ary_new_from_args(long n, ...) { va_list ar; VALUE ary; @@ -459,7 +456,7 @@ rb_ary_new3(long n, ...) https://github.com/ruby/ruby/blob/trunk/array.c#L456 } VALUE -rb_ary_new4(long n, const VALUE *elts) +rb_ary_new_from_values(long n, const VALUE *elts) { VALUE ary; Index: include/ruby/intern.h =================================================================== --- include/ruby/intern.h (revision 40998) +++ include/ruby/intern.h (revision 40999) @@ -48,9 +48,9 @@ void rb_mem_clear(register VALUE*, regis https://github.com/ruby/ruby/blob/trunk/include/ruby/intern.h#L48 VALUE rb_assoc_new(VALUE, VALUE); VALUE rb_check_array_type(VALUE); VALUE rb_ary_new(void); -VALUE rb_ary_new2(long); -VALUE rb_ary_new3(long,...); -VALUE rb_ary_new4(long, const VALUE *); +VALUE rb_ary_new_capa(long capa); +VALUE rb_ary_new_from_args(long n, ...); +VALUE rb_ary_new_from_values(long n, const VALUE *elts); VALUE rb_ary_tmp_new(long); void rb_ary_free(VALUE); void rb_ary_modify(VALUE); @@ -86,6 +86,9 @@ VALUE rb_ary_cmp(VALUE, VALUE); https://github.com/ruby/ruby/blob/trunk/include/ruby/intern.h#L86 VALUE rb_ary_replace(VALUE copy, VALUE orig); VALUE rb_get_values_at(VALUE, long, int, VALUE*, VALUE(*)(VALUE,long)); VALUE rb_ary_resize(VALUE ary, long len); +#define rb_ary_new2 rb_ary_new_capa +#define rb_ary_new3 rb_ary_new_from_args +#define rb_ary_new4 rb_ary_new_from_values /* bignum.c */ VALUE rb_big_new(long, int); int rb_bigzero_p(VALUE x); Index: ChangeLog =================================================================== --- ChangeLog (revision 40998) +++ ChangeLog (revision 40999) @@ -1,3 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Fri May 31 17:04:45 2013 Nobuyoshi Nakada <nobu@r...> + + * array.c (rb_ary_new_capa): add better names of rb_ary_new2. + + * array.c (rb_ary_new_from_args): ditto for rb_ary_new3. + + * array.c (rb_ary_new_from_values): ditto for rb_ary_new4. + Fri May 31 16:35:44 2013 Nobuyoshi Nakada <nobu@r...> * configure.in (HAVE_ATTRIBUTE_FUNCTION_ALIAS): define to tell if -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/