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

ruby-changes:67153

From: Nobuyoshi <ko1@a...>
Date: Sat, 14 Aug 2021 23:12:23 +0900 (JST)
Subject: [ruby-changes:67153] 58d82eacef (master): Add some "cold" marks

https://git.ruby-lang.org/ruby.git/commit/?id=58d82eacef

From 58d82eacefe8060bc3f689491a423de5f2581d1d Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Sat, 14 Aug 2021 10:16:37 +0900
Subject: Add some "cold" marks

---
 error.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/error.c b/error.c
index ef01e94..a67b1b1 100644
--- a/error.c
+++ b/error.c
@@ -972,7 +972,7 @@ rb_builtin_class_name(VALUE x) https://github.com/ruby/ruby/blob/trunk/error.c#L972
     return etype;
 }
 
-NORETURN(static void unexpected_type(VALUE, int, int));
+COLDFUNC NORETURN(static void unexpected_type(VALUE, int, int));
 #define UNDEF_LEAKED "undef leaked to the Ruby space"
 
 static void
@@ -1001,7 +1001,7 @@ rb_check_type(VALUE x, int t) https://github.com/ruby/ruby/blob/trunk/error.c#L1001
 {
     int xt;
 
-    if (x == Qundef) {
+    if (RB_UNLIKELY(x == Qundef)) {
 	rb_bug(UNDEF_LEAKED);
     }
 
@@ -1022,7 +1022,7 @@ rb_check_type(VALUE x, int t) https://github.com/ruby/ruby/blob/trunk/error.c#L1022
 void
 rb_unexpected_type(VALUE x, int t)
 {
-    if (x == Qundef) {
+    if (RB_UNLIKELY(x == Qundef)) {
 	rb_bug(UNDEF_LEAKED);
     }
 
-- 
cgit v1.1


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

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