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

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

Issue 2907563002: allocator/Windows: delete the old non-unified allocator-shim (Closed)
Patch Set: remove comment Created 3 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 unified diff | Download patch
« no previous file with comments | « base/allocator/allocator_shim_win.cc ('k') | base/security_unittest.cc » ('j') | 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 <stddef.h> 9 #include <stddef.h>
10 10
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 ASSERT_TRUE(base::allocator::IsAllocatorInitialized()); 97 ASSERT_TRUE(base::allocator::IsAllocatorInitialized());
98 98
99 #if defined(OS_MACOSX) 99 #if defined(OS_MACOSX)
100 base::allocator::UninterceptMallocZonesForTesting(); 100 base::allocator::UninterceptMallocZonesForTesting();
101 #endif 101 #endif
102 } 102 }
103 103
104 // OpenBSD does not support these tests. Don't test these on ASan/TSan/MSan 104 // OpenBSD does not support these tests. Don't test these on ASan/TSan/MSan
105 // configurations: only test the real allocator. 105 // configurations: only test the real allocator.
106 // Windows only supports these tests with the allocator shim in place. 106 // Windows only supports these tests with the allocator shim in place.
107 #if !defined(OS_OPENBSD) && \ 107 #if !defined(OS_OPENBSD) && BUILDFLAG(USE_ALLOCATOR_SHIM) && \
108 BUILDFLAG(ENABLE_WIN_ALLOCATOR_SHIM_TESTS) && \
109 !defined(MEMORY_TOOL_REPLACES_ALLOCATOR) 108 !defined(MEMORY_TOOL_REPLACES_ALLOCATOR)
110 109
111 namespace { 110 namespace {
112 #if defined(OS_WIN) 111 #if defined(OS_WIN)
113 // Windows raises an exception rather than using LOG(FATAL) in order to make the 112 // Windows raises an exception rather than using LOG(FATAL) in order to make the
114 // exit code unique to OOM. 113 // exit code unique to OOM.
115 const char* kOomRegex = ""; 114 const char* kOomRegex = "";
116 const int kExitCode = base::win::kOomExceptionCode; 115 const int kExitCode = base::win::kOomExceptionCode;
117 #else 116 #else
118 const char* kOomRegex = "Out of memory"; 117 const char* kOomRegex = "Out of memory";
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 bytes = static_cast<const char*>(value_); 502 bytes = static_cast<const char*>(value_);
504 for (size_t i = 0; i < (kSafeCallocItems * kSafeCallocSize); ++i) 503 for (size_t i = 0; i < (kSafeCallocItems * kSafeCallocSize); ++i)
505 EXPECT_EQ(0, bytes[i]); 504 EXPECT_EQ(0, bytes[i]);
506 free(value_); 505 free(value_);
507 506
508 EXPECT_FALSE(base::UncheckedCalloc(1, test_size_, &value_)); 507 EXPECT_FALSE(base::UncheckedCalloc(1, test_size_, &value_));
509 EXPECT_TRUE(value_ == NULL); 508 EXPECT_TRUE(value_ == NULL);
510 } 509 }
511 #endif // !defined(OS_OPENBSD) && BUILDFLAG(ENABLE_WIN_ALLOCATOR_SHIM_TESTS) && 510 #endif // !defined(OS_OPENBSD) && BUILDFLAG(ENABLE_WIN_ALLOCATOR_SHIM_TESTS) &&
512 // !defined(MEMORY_TOOL_REPLACES_ALLOCATOR) 511 // !defined(MEMORY_TOOL_REPLACES_ALLOCATOR)
OLDNEW
« no previous file with comments | « base/allocator/allocator_shim_win.cc ('k') | base/security_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698