mark assert_fail as cold and noreturn; move assert to internal.h (see issue #1091, and python/cpython#134586)

This commit is contained in:
daanx 2025-05-30 09:29:35 -07:00
parent 3e32b4c385
commit 715acc0329
3 changed files with 69 additions and 48 deletions

View file

@ -525,7 +525,7 @@ void _mi_warning_message(const char* fmt, ...) {
#if MI_DEBUG
void _mi_assert_fail(const char* assertion, const char* fname, unsigned line, const char* func ) {
mi_decl_noreturn mi_decl_cold void _mi_assert_fail(const char* assertion, const char* fname, unsigned line, const char* func ) mi_attr_noexcept {
_mi_fprintf(NULL, NULL, "mimalloc: assertion failed: at \"%s\":%u, %s\n assertion: \"%s\"\n", fname, line, (func==NULL?"":func), assertion);
abort();
}