mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 15:23:51 +00:00
Bug 822431 - Use MOZ_UNLIKELY in MOZ_ASSERT. r=waldo
This commit is contained in:
parent
e09ae39f71
commit
4cef91ed01
@ -10,6 +10,7 @@
|
||||
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/Compiler.h"
|
||||
#include "mozilla/Likely.h"
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
@ -248,7 +249,7 @@ MOZ_ReportAssertionFailure(const char* s, const char* file, int ln)
|
||||
/* First the single-argument form. */
|
||||
# define MOZ_ASSERT_HELPER1(expr) \
|
||||
do { \
|
||||
if (!(expr)) { \
|
||||
if (MOZ_UNLIKELY(!(expr))) { \
|
||||
MOZ_ReportAssertionFailure(#expr, __FILE__, __LINE__); \
|
||||
MOZ_CRASH(); \
|
||||
} \
|
||||
@ -256,7 +257,7 @@ MOZ_ReportAssertionFailure(const char* s, const char* file, int ln)
|
||||
/* Now the two-argument form. */
|
||||
# define MOZ_ASSERT_HELPER2(expr, explain) \
|
||||
do { \
|
||||
if (!(expr)) { \
|
||||
if (MOZ_UNLIKELY(!(expr))) { \
|
||||
MOZ_ReportAssertionFailure(#expr " (" explain ")", __FILE__, __LINE__); \
|
||||
MOZ_CRASH(); \
|
||||
} \
|
||||
|
Loading…
Reference in New Issue
Block a user