aboutsummaryrefslogtreecommitdiff
path: root/assert
diff options
context:
space:
mode:
authorNoah Goldstein <goldstein.w.n@gmail.com>2024-07-26 16:35:13 +0800
committerNoah Goldstein <goldstein.w.n@gmail.com>2024-07-26 20:41:00 +0800
commitf6f904745942540c7ea99c403b75b695ee560035 (patch)
tree743fcbeb72f90f348260f173ccab95d2e46957fc /assert
parent89cddc8a7096f3d9225868304d2bc0a1aaf07d63 (diff)
downloadglibc-f6f904745942540c7ea99c403b75b695ee560035.zip
glibc-f6f904745942540c7ea99c403b75b695ee560035.tar.gz
glibc-f6f904745942540c7ea99c403b75b695ee560035.tar.bz2
assert: Mark `__assert_fail` as `cold`
This helps compilers split the codegen for setting up the arguments (`__expression`, `__filename`, etc...) from the potentially hot cold where the `assert` is to a presumably cold region on the assertion failure path. Reviewed-by: Florian Weimer <fweimer@redhat.com> Reviewed-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'assert')
-rw-r--r--assert/assert.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/assert/assert.h b/assert/assert.h
index 266a41d..14d3be9 100644
--- a/assert/assert.h
+++ b/assert/assert.h
@@ -66,18 +66,18 @@ __BEGIN_DECLS
/* This prints an "Assertion failed" message and aborts. */
extern void __assert_fail (const char *__assertion, const char *__file,
unsigned int __line, const char *__function)
- __THROW __attribute__ ((__noreturn__));
+ __THROW __attribute__ ((__noreturn__)) __COLD;
/* Likewise, but prints the error text for ERRNUM. */
extern void __assert_perror_fail (int __errnum, const char *__file,
unsigned int __line, const char *__function)
- __THROW __attribute__ ((__noreturn__));
+ __THROW __attribute__ ((__noreturn__)) __COLD;
/* The following is not at all used here but needed for standard
compliance. */
extern void __assert (const char *__assertion, const char *__file, int __line)
- __THROW __attribute__ ((__noreturn__));
+ __THROW __attribute__ ((__noreturn__)) __COLD;
__END_DECLS