stdlib: Mark abort as cold

This helps HotColdSplitting in GCC/LLVM.

Thought about doing `exit` as well since its only called once per
process, but since its easy to imagine a hot path leading into
`exit(0)`, its less clear if its profitable.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
This commit is contained in:
Noah Goldstein 2024-07-29 15:34:33 +08:00
parent 11ad033e1c
commit e3b0b3484c

View File

@ -727,7 +727,7 @@ extern void *aligned_alloc (size_t __alignment, size_t __size)
#endif
/* Abort execution and generate a core-dump. */
extern void abort (void) __THROW __attribute__ ((__noreturn__));
extern void abort (void) __THROW __attribute__ ((__noreturn__)) __COLD;
/* Register a function to be called when `exit' is called. */