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

Unified Diff: base/security_unittest.cc

Issue 1124763003: Update from https://crrev.com/327068 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: update nacl, buildtools, fix display_change_notifier_unittest 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
Index: base/security_unittest.cc
diff --git a/base/security_unittest.cc b/base/security_unittest.cc
index f4c60a75db7291df8f4d51b8a495d48e6915a34d..07ba6f5a0f2af7fed188fa441beffa601c8a2bb3 100644
--- a/base/security_unittest.cc
+++ b/base/security_unittest.cc
@@ -69,7 +69,7 @@ void ExhaustMemoryWithRealloc() {
// We also use it so that the compiler doesn't discard certain return values
// as something we don't need (see the comment with calloc below).
template <typename Type>
-Type HideValueFromCompiler(volatile Type value) {
+NOINLINE Type HideValueFromCompiler(volatile Type value) {
#if defined(__GNUC__)
// In a GCC compatible compiler (GCC or Clang), make this compiler barrier
// more robust than merely using "volatile".
@@ -293,8 +293,8 @@ bool CallocReturnsNull(size_t nmemb, size_t size) {
scoped_ptr<char, base::FreeDeleter> array_pointer(
static_cast<char*>(calloc(nmemb, size)));
// We need the call to HideValueFromCompiler(): we have seen LLVM
- // optimize away the call to calloc() entirely and assume
- // the pointer to not be NULL.
+ // optimize away the call to calloc() entirely and assume the pointer to not
+ // be NULL.
return HideValueFromCompiler(array_pointer.get()) == NULL;
}

Powered by Google App Engine
This is Rietveld 408576698