Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2320)

Unified Diff: base/logging.h

Issue 1124673004: Chrome OS: Reduce NOTREACHED() overhead for release builds. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove function name from log for further size gains. Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/logging.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/logging.h
diff --git a/base/logging.h b/base/logging.h
index cc0a5aa11bc4de78eaf868d1af2e289236baf4f1..ea096d19f729cb9043b0a6fcaea7a935e0d943aa 100644
--- a/base/logging.h
+++ b/base/logging.h
@@ -700,8 +700,12 @@ const LogSeverity LOG_DCHECK = LOG_INFO;
#define DCHECK_IMPLIES(val1, val2) DCHECK(!(val1) || (val2))
#if !DCHECK_IS_ON() && defined(OS_CHROMEOS)
-#define NOTREACHED() LOG(ERROR) << "NOTREACHED() hit in " << \
- __FUNCTION__ << ". "
+// Implement logging of NOTREACHED() as a dedicated function to get function
+// call overhead down to a minimum.
+void LogErrorNotReached(const char* file, int line);
+#define NOTREACHED() \
+ true ? ::logging::LogErrorNotReached(__FILE__, __LINE__) \
+ : EAT_STREAM_PARAMETERS
#else
#define NOTREACHED() DCHECK(false)
#endif
« no previous file with comments | « no previous file | base/logging.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698