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

ruby-changes:55772

From: Nobuyoshi <ko1@a...>
Date: Wed, 22 May 2019 16:54:49 +0900 (JST)
Subject: [ruby-changes:55772] Nobuyoshi Nakada: 32dd1a798a (trunk): gc.c: revert b00f280d4b "Eagerly name modules and classes"

https://git.ruby-lang.org/ruby.git/commit/?id=32dd1a798a

From 32dd1a798a6d042dbf91e24e9c9f44d94e68f721 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Wed, 22 May 2019 16:52:19 +0900
Subject: gc.c: revert b00f280d4b "Eagerly name modules and classes"

* gc.c (rb_raw_obj_info): new string objects cannot allocate to
  create new class path name during GC.

diff --git a/gc.c b/gc.c
index 6df81b9..394fd27 100644
--- a/gc.c
+++ b/gc.c
@@ -11097,7 +11097,7 @@ rb_raw_obj_info(char *buff, const int buff_size, VALUE obj) https://github.com/ruby/ruby/blob/trunk/gc.c#L11097
 	}
 	else {
             if (RTEST(RBASIC(obj)->klass)) {
-	    VALUE class_path = rb_class_path(RBASIC(obj)->klass);
+	    VALUE class_path = rb_class_path_cached(RBASIC(obj)->klass);
 	    if (!NIL_P(class_path)) {
                 APPENDF((BUFF_ARGS, "(%s)", RSTRING_PTR(class_path)));
 	    }
@@ -11151,7 +11151,7 @@ rb_raw_obj_info(char *buff, const int buff_size, VALUE obj) https://github.com/ruby/ruby/blob/trunk/gc.c#L11151
           case T_CLASS:
           case T_MODULE:
             {
-                VALUE class_path = rb_class_path(obj);
+                VALUE class_path = rb_class_path_cached(obj);
                 if (!NIL_P(class_path)) {
                     APPENDF((BUFF_ARGS, "%s", RSTRING_PTR(class_path)));
                 }
@@ -11159,7 +11159,7 @@ rb_raw_obj_info(char *buff, const int buff_size, VALUE obj) https://github.com/ruby/ruby/blob/trunk/gc.c#L11159
             }
           case T_ICLASS:
             {
-                VALUE class_path = rb_class_path(RBASIC_CLASS(obj));
+                VALUE class_path = rb_class_path_cached(RBASIC_CLASS(obj));
                 if (!NIL_P(class_path)) {
                     APPENDF((BUFF_ARGS, "src:%s", RSTRING_PTR(class_path)));
                 }
-- 
cgit v0.10.2


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

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