summaryrefslogtreecommitdiff
path: root/error.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-08-14 10:16:37 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-08-14 23:11:58 +0900
commit58d82eacefe8060bc3f689491a423de5f2581d1d (patch)
tree9b8a865ccbca33663d0f50ff628504b95bf51131 /error.c
parentedd27e120eca13be1754d4111dfc3cf2ab2f99f8 (diff)
Add some "cold" marks
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4741
Diffstat (limited to 'error.c')
-rw-r--r--error.c6
1 files 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);
}