ruby-changes:20195
From: tadf <ko1@a...>
Date: Mon, 27 Jun 2011 08:02:03 +0900 (JST)
Subject: [ruby-changes:20195] tadf:r32243 (trunk): * ext/date/date_parse.c: should use ALLOCA_N.
tadf 2011-06-27 08:01:56 +0900 (Mon, 27 Jun 2011) New Revision: 32243 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=32243 Log: * ext/date/date_parse.c: should use ALLOCA_N. Modified files: trunk/ChangeLog trunk/ext/date/date_parse.c Index: ChangeLog =================================================================== --- ChangeLog (revision 32242) +++ ChangeLog (revision 32243) @@ -1,3 +1,7 @@ +Mon Jun 27 08:01:19 2011 Tadayoshi Funaba <tadf@d...> + + * ext/date/date_parse.c: should use ALLOCA_N. + Mon Jun 27 01:34:18 2011 Nobuyoshi Nakada <nobu@r...> * test/etc/test_etc.rb (TestEtc#test_get{pw,gr}nam): skip entries Index: ext/date/date_parse.c =================================================================== --- ext/date/date_parse.c (revision 32242) +++ ext/date/date_parse.c (revision 32243) @@ -154,7 +154,7 @@ { char *buf; - buf = ALLOC_N(char, ep - bp + 1); + buf = ALLOCA_N(char, ep - bp + 1); memcpy(buf, bp, ep - bp); buf[ep - bp] = '\0'; iy = cstr2num(buf); @@ -178,7 +178,7 @@ { char *buf; - buf = ALLOC_N(char, ep - bp + 1); + buf = ALLOCA_N(char, ep - bp + 1); memcpy(buf, bp, ep - bp); buf[ep - bp] = '\0'; im = cstr2num(buf); @@ -200,7 +200,7 @@ { char *buf; - buf = ALLOC_N(char, ep - bp + 1); + buf = ALLOCA_N(char, ep - bp + 1); memcpy(buf, bp, ep - bp); buf[ep - bp] = '\0'; id = cstr2num(buf); @@ -358,7 +358,7 @@ l = RSTRING_LEN(str); s = RSTRING_PTR(str); - dest = d = ALLOC_N(char, l + 1); + dest = d = ALLOCA_N(char, l + 1); for (i = 0; i < l; i++) { if (isspace(s[i]) || s[i] == '\0') { @@ -472,7 +472,7 @@ if (strpbrk(RSTRING_PTR(str), ",.")) { char *a, *b; - a = ALLOC_N(char, RSTRING_LEN(str) + 1); + a = ALLOCA_N(char, RSTRING_LEN(str) + 1); strcpy(a, RSTRING_PTR(str)); b = strpbrk(a, ",."); *b = '\0'; @@ -1368,7 +1368,7 @@ set_hash("zone", s5); if (*cs5 == '[') { - char *buf = ALLOC_N(char, l5 + 1); + char *buf = ALLOCA_N(char, l5 + 1); char *s1, *s2, *s3; VALUE zone; @@ -1521,8 +1521,8 @@ static const char pat_source[] = "[^-+',./:@[:alnum:]\\[\\]]+"; static VALUE pat = Qnil; + REGCOMP_0(pat); str = rb_str_dup(str); - REGCOMP_0(pat); f_gsub_bang(str, pat, asp_string()); } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/