ruby-changes:53749
From: nobu <ko1@a...>
Date: Sun, 25 Nov 2018 12:36:17 +0900 (JST)
Subject: [ruby-changes:53749] nobu:r65966 (trunk): Prefer ALLOCV over ALLOCA
nobu 2018-11-25 12:36:10 +0900 (Sun, 25 Nov 2018) New Revision: 65966 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=65966 Log: Prefer ALLOCV over ALLOCA Modified files: trunk/variable.c Index: variable.c =================================================================== --- variable.c (revision 65965) +++ variable.c (revision 65966) @@ -610,10 +610,12 @@ global_id(const char *name) https://github.com/ruby/ruby/blob/trunk/variable.c#L610 if (name[0] == '$') id = rb_intern(name); else { size_t len = strlen(name); - char *buf = ALLOCA_N(char, len+1); + VALUE vbuf = 0; + char *buf = ALLOCV_N(char, vbuf, len+1); buf[0] = '$'; memcpy(buf+1, name, len); id = rb_intern2(buf, len+1); + ALLOCV_END(vbuf); } return id; } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/