ruby-changes:43052
From: nobu <ko1@a...>
Date: Mon, 23 May 2016 13:31:57 +0900 (JST)
Subject: [ruby-changes:43052] nobu:r55126 (trunk): tkutil.c: GC guards
nobu 2016-05-23 13:31:54 +0900 (Mon, 23 May 2016) New Revision: 55126 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=55126 Log: tkutil.c: GC guards * ext/tk/tkutil/tkutil.c (cbsubst_table_setup): add GC guards instead of volatile after the uses. Modified files: trunk/ext/tk/tkutil/tkutil.c Index: ext/tk/tkutil/tkutil.c =================================================================== --- ext/tk/tkutil/tkutil.c (revision 55125) +++ ext/tk/tkutil/tkutil.c (revision 55126) @@ -1564,9 +1564,9 @@ cbsubst_table_setup(argc, argv, self) https://github.com/ruby/ruby/blob/trunk/ext/tk/tkutil/tkutil.c#L1564 VALUE self; { volatile VALUE cbsubst_obj; - volatile VALUE key_inf; - volatile VALUE longkey_inf; - volatile VALUE proc_inf; + VALUE key_inf; + VALUE longkey_inf; + VALUE proc_inf; VALUE inf, subst, name, type, ivar, proc; const VALUE *infp; ID id; @@ -1616,6 +1616,7 @@ cbsubst_table_setup(argc, argv, self) https://github.com/ruby/ruby/blob/trunk/ext/tk/tkutil/tkutil.c#L1616 rb_attr(self, id, 1, 0, Qtrue); } + RB_GC_GUARD(key_inf); /* @@ -1647,6 +1648,7 @@ cbsubst_table_setup(argc, argv, self) https://github.com/ruby/ruby/blob/trunk/ext/tk/tkutil/tkutil.c#L1648 rb_attr(self, id, 1, 0, Qtrue); } + RB_GC_GUARD(longkey_inf); /* * procs : array of [type, proc] @@ -1663,6 +1665,7 @@ cbsubst_table_setup(argc, argv, self) https://github.com/ruby/ruby/blob/trunk/ext/tk/tkutil/tkutil.c#L1665 type = INT2FIX(*(RSTRING_PTR(type))); rb_hash_aset(subst_inf->proc, type, proc); } + RB_GC_GUARD(proc_inf); rb_const_set(self, ID_SUBST_INFO, cbsubst_obj); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/