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

Side by Side Diff: base/process_util_unittest.cc

Issue 9701031: Add preliminary OOM support for Mountain Lion. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tweak comments Created 8 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « base/process_util_mac.mm ('k') | third_party/apple_apsl/CFBase.h » ('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 <limits> 7 #include <limits>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/eintr_wrapper.h" 10 #include "base/eintr_wrapper.h"
(...skipping 1100 matching lines...) Expand 10 before | Expand all | Expand 10 after
1111 ASSERT_DEATH({ 1111 ASSERT_DEATH({
1112 SetUpInDeathAssert(); 1112 SetUpInDeathAssert();
1113 value_ = zone_memalign(zone, 8, test_size_); 1113 value_ = zone_memalign(zone, 8, test_size_);
1114 }, ""); 1114 }, "");
1115 } 1115 }
1116 } 1116 }
1117 1117
1118 // Since these allocation functions take a signed size, it's possible that 1118 // Since these allocation functions take a signed size, it's possible that
1119 // calling them just once won't be enough to exhaust memory. In the 32-bit 1119 // calling them just once won't be enough to exhaust memory. In the 32-bit
1120 // environment, it's likely that these allocation attempts will fail because 1120 // environment, it's likely that these allocation attempts will fail because
1121 // not enough contiguous address space is availble. In the 64-bit environment, 1121 // not enough contiguous address space is available. In the 64-bit environment,
1122 // it's likely that they'll fail because they would require a preposterous 1122 // it's likely that they'll fail because they would require a preposterous
1123 // amount of (virtual) memory. 1123 // amount of (virtual) memory.
1124 1124
1125 TEST_F(OutOfMemoryDeathTest, CFAllocatorSystemDefault) { 1125 TEST_F(OutOfMemoryDeathTest, CFAllocatorSystemDefault) {
1126 ASSERT_DEATH({ 1126 ASSERT_DEATH({
1127 SetUpInDeathAssert(); 1127 SetUpInDeathAssert();
1128 while ((value_ = 1128 while ((value_ =
1129 base::AllocateViaCFAllocatorSystemDefault(signed_test_size_))) {} 1129 base::AllocateViaCFAllocatorSystemDefault(signed_test_size_))) {}
1130 }, ""); 1130 }, "");
1131 } 1131 }
(...skipping 24 matching lines...) Expand all
1156 SetUpInDeathAssert(); 1156 SetUpInDeathAssert();
1157 while ((value_ = base::AllocatePsychoticallyBigObjCObject())) {} 1157 while ((value_ = base::AllocatePsychoticallyBigObjCObject())) {}
1158 }, ""); 1158 }, "");
1159 } 1159 }
1160 1160
1161 #endif // !ARCH_CPU_64_BITS 1161 #endif // !ARCH_CPU_64_BITS
1162 #endif // OS_MACOSX 1162 #endif // OS_MACOSX
1163 1163
1164 #endif // !defined(OS_ANDROID) && !defined(OS_OPENBSD) && 1164 #endif // !defined(OS_ANDROID) && !defined(OS_OPENBSD) &&
1165 // !defined(OS_WIN) && !defined(ADDRESS_SANITIZER) 1165 // !defined(OS_WIN) && !defined(ADDRESS_SANITIZER)
OLDNEW
« no previous file with comments | « base/process_util_mac.mm ('k') | third_party/apple_apsl/CFBase.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698