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

Side by Side Diff: base/process/memory_unittest.cc

Issue 1085443007: [MemSheriff] Don't run OOM tests under tools that replace memory allocator. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #define _CRT_SECURE_NO_WARNINGS 5 #define _CRT_SECURE_NO_WARNINGS
6 6
7 #include "base/process/memory.h" 7 #include "base/process/memory.h"
8 8
9 #include <limits> 9 #include <limits>
10 10
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 "was not malloc\\(\\)-ed"); 121 "was not malloc\\(\\)-ed");
122 #else 122 #else
123 ADD_FAILURE() << "This test is not supported in this build configuration."; 123 ADD_FAILURE() << "This test is not supported in this build configuration.";
124 #endif 124 #endif
125 } 125 }
126 126
127 #endif // defined(OS_MACOSX) 127 #endif // defined(OS_MACOSX)
128 128
129 // Android doesn't implement set_new_handler, so we can't use the 129 // Android doesn't implement set_new_handler, so we can't use the
130 // OutOfMemoryTest cases. OpenBSD does not support these tests either. 130 // OutOfMemoryTest cases. OpenBSD does not support these tests either.
131 // Don't test these on ASAN configurations: only test the real allocator. 131 // Don't test these on ASan/TSan/MSan configurations: only test the real
132 // allocator.
132 // TODO(vandebo) make this work on Windows too. 133 // TODO(vandebo) make this work on Windows too.
133 #if !defined(OS_ANDROID) && !defined(OS_OPENBSD) && !defined(OS_WIN) && \ 134 #if !defined(OS_ANDROID) && !defined(OS_OPENBSD) && !defined(OS_WIN) && \
134 !defined(ADDRESS_SANITIZER) 135 !defined(MEMORY_TOOL_REPLACES_ALLOCATOR)
135 136
136 #if defined(USE_TCMALLOC) 137 #if defined(USE_TCMALLOC)
137 extern "C" { 138 extern "C" {
138 int tc_set_new_mode(int mode); 139 int tc_set_new_mode(int mode);
139 } 140 }
140 #endif // defined(USE_TCMALLOC) 141 #endif // defined(USE_TCMALLOC)
141 142
142 namespace { 143 namespace {
143 const char *kOomRegex = "Out of memory"; 144 const char *kOomRegex = "Out of memory";
144 } // namespace 145 } // namespace
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 for (size_t i = 0; i < (kSafeCallocItems * kSafeCallocSize); ++i) 410 for (size_t i = 0; i < (kSafeCallocItems * kSafeCallocSize); ++i)
410 EXPECT_EQ(0, bytes[i]); 411 EXPECT_EQ(0, bytes[i]);
411 free(value_); 412 free(value_);
412 413
413 EXPECT_FALSE(base::UncheckedCalloc(1, test_size_, &value_)); 414 EXPECT_FALSE(base::UncheckedCalloc(1, test_size_, &value_));
414 EXPECT_TRUE(value_ == NULL); 415 EXPECT_TRUE(value_ == NULL);
415 } 416 }
416 #endif // !defined(MEMORY_TOOL_REPLACES_ALLOCATOR) 417 #endif // !defined(MEMORY_TOOL_REPLACES_ALLOCATOR)
417 #endif // !defined(OS_ANDROID) && !defined(OS_OPENBSD) && !defined(OS_WIN) && 418 #endif // !defined(OS_ANDROID) && !defined(OS_OPENBSD) && !defined(OS_WIN) &&
418 // !defined(ADDRESS_SANITIZER) 419 // !defined(ADDRESS_SANITIZER)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698