From 58d82eacefe8060bc3f689491a423de5f2581d1d Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sat, 14 Aug 2021 10:16:37 +0900 Subject: [PATCH] Add some "cold" marks --- error.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/error.c b/error.c index ef01e94044..a67b1b11cd 100644 --- a/error.c +++ b/error.c @@ -972,7 +972,7 @@ rb_builtin_class_name(VALUE x) 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) { 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) void rb_unexpected_type(VALUE x, int t) { - if (x == Qundef) { + if (RB_UNLIKELY(x == Qundef)) { rb_bug(UNDEF_LEAKED); }