| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 1079 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1090 ptr = partitionAllocGeneric(genericAllocator.root(), size); | 1090 ptr = partitionAllocGeneric(genericAllocator.root(), size); |
| 1091 EXPECT_TRUE(ptr); | 1091 EXPECT_TRUE(ptr); |
| 1092 partitionFreeGeneric(genericAllocator.root(), ptr); | 1092 partitionFreeGeneric(genericAllocator.root(), ptr); |
| 1093 | 1093 |
| 1094 EXPECT_TRUE(bucket->activePagesHead); | 1094 EXPECT_TRUE(bucket->activePagesHead); |
| 1095 EXPECT_TRUE(bucket->freePagesHead); | 1095 EXPECT_TRUE(bucket->freePagesHead); |
| 1096 | 1096 |
| 1097 TestShutdown(); | 1097 TestShutdown(); |
| 1098 } | 1098 } |
| 1099 | 1099 |
| 1100 #if !OS(ANDROID) | 1100 #if !OS(ANDROID) && !OS(IOS) |
| 1101 | 1101 |
| 1102 // Make sure that malloc(-1) dies. | 1102 // Make sure that malloc(-1) dies. |
| 1103 // In the past, we had an integer overflow that would alias malloc(-1) to | 1103 // In the past, we had an integer overflow that would alias malloc(-1) to |
| 1104 // malloc(0), which is not good. | 1104 // malloc(0), which is not good. |
| 1105 TEST(PartitionAllocDeathTest, LargeAllocs) | 1105 TEST(PartitionAllocDeathTest, LargeAllocs) |
| 1106 { | 1106 { |
| 1107 TestSetup(); | 1107 TestSetup(); |
| 1108 // Largest alloc. | 1108 // Largest alloc. |
| 1109 EXPECT_DEATH(partitionAllocGeneric(genericAllocator.root(), static_cast<size
_t>(-1)), ""); | 1109 EXPECT_DEATH(partitionAllocGeneric(genericAllocator.root(), static_cast<size
_t>(-1)), ""); |
| 1110 // And the smallest allocation we expect to die. | 1110 // And the smallest allocation we expect to die. |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1189 EXPECT_EQ(32u, WTF::countLeadingZerosSizet(0u)); | 1189 EXPECT_EQ(32u, WTF::countLeadingZerosSizet(0u)); |
| 1190 EXPECT_EQ(31u, WTF::countLeadingZerosSizet(1u)); | 1190 EXPECT_EQ(31u, WTF::countLeadingZerosSizet(1u)); |
| 1191 EXPECT_EQ(1u, WTF::countLeadingZerosSizet(1u << 30)); | 1191 EXPECT_EQ(1u, WTF::countLeadingZerosSizet(1u << 30)); |
| 1192 EXPECT_EQ(0u, WTF::countLeadingZerosSizet(1u << 31)); | 1192 EXPECT_EQ(0u, WTF::countLeadingZerosSizet(1u << 31)); |
| 1193 #endif | 1193 #endif |
| 1194 } | 1194 } |
| 1195 | 1195 |
| 1196 } // namespace | 1196 } // namespace |
| 1197 | 1197 |
| 1198 #endif // !defined(MEMORY_TOOL_REPLACES_ALLOCATOR) | 1198 #endif // !defined(MEMORY_TOOL_REPLACES_ALLOCATOR) |
| OLD | NEW |