[前][次][番号順一覧][スレッド一覧]

ruby-changes:31131

From: nobu <ko1@a...>
Date: Wed, 9 Oct 2013 17:40:25 +0900 (JST)
Subject: [ruby-changes:31131] nobu:r43210 (trunk): string.c: mark frozen string

nobu	2013-10-09 17:40:18 +0900 (Wed, 09 Oct 2013)

  New Revision: 43210

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=43210

  Log:
    string.c: mark frozen string
    
    * string.c (rb_fstring): because of lazy sweep, str may be unmaked
      already and swept at next time, so mark it for the time being.
      [ruby-core:57756]

  Modified files:
    trunk/ChangeLog
    trunk/string.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 43209)
+++ ChangeLog	(revision 43210)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Wed Oct  9 17:40:16 2013  Nobuyoshi Nakada  <nobu@r...>
+
+	* string.c (rb_fstring): because of lazy sweep, str may be unmaked
+	  already and swept at next time, so mark it for the time being.
+	  [ruby-core:57756]
+
 Wed Oct  9 13:53:14 2013  Nobuyoshi Nakada  <nobu@r...>
 
 	* compar.c (cmp_eq): fail if recursion.  [ruby-core:57736] [Bug #9003]
Index: string.c
===================================================================
--- string.c	(revision 43209)
+++ string.c	(revision 43210)
@@ -146,6 +146,9 @@ rb_fstring(VALUE str) https://github.com/ruby/ruby/blob/trunk/string.c#L146
     st_data_t fstr;
     if (st_lookup(frozen_strings, (st_data_t)str, &fstr)) {
 	str = (VALUE)fstr;
+	/* because of lazy sweep, str may be unmaked already and swept
+	 * at next time */
+	rb_gc_mark(str);
     }
     else {
 	str = rb_str_new_frozen(str);

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]