Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-134586: mark_mi_assert_fail asnoreturn,cold andthrow#134624

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Merged
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
add__attribute__((cold)) on_mi_assert_fail
  • Loading branch information
@picnixz
picnixz committedMay 24, 2025
commitd97221bd162d7db42a0be5b9537996fbe7732ba8
13 changes: 12 additions & 1 deletionInclude/internal/mimalloc/mimalloc/types.h
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -58,6 +58,16 @@ terms of the MIT license. A copy of the license can be found in the file
#else
#define mi_decl_noreturn
#endif

/*
* 'cold' attribute seems to have been fully supported since GCC 4.x.
* See https://github.com/gcc-mirror/gcc/commit/52bf96d2f299e9e6.
*/
#if (defined(__GNUC__) && (__GNUC__ >= 4)) || defined(__clang__)
#define mi_decl_cold __attribute__((cold))
#else
#define mi_decl_cold
#endif
#endif

// ------------------------------------------------------
Expand DownExpand Up@@ -592,7 +602,8 @@ struct mi_heap_s {

#if (MI_DEBUG)
// use our own assertion to print without memory allocation
mi_decl_noreturn void _mi_assert_fail(const char* assertion, const char* fname, unsigned int line, const char* func);
mi_decl_noreturn mi_decl_cold
void _mi_assert_fail(const char* assertion, const char* fname, unsigned int line, const char* func);
#define mi_assert(expr) ((expr) ? (void)0 : _mi_assert_fail(#expr,__FILE__,__LINE__,__func__))
#else
#define mi_assert(x)
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp