| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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) |
| OLD | NEW |