Chromium Code Reviews| 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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 180 | 180 |
| 181 static NEVER_INLINE void partitionsOutOfMemoryUsing16M() | 181 static NEVER_INLINE void partitionsOutOfMemoryUsing16M() |
| 182 { | 182 { |
| 183 size_t signature = 16 * 1024 * 1024; | 183 size_t signature = 16 * 1024 * 1024; |
| 184 base::debug::Alias(&signature); | 184 base::debug::Alias(&signature); |
| 185 IMMEDIATE_CRASH(); | 185 IMMEDIATE_CRASH(); |
| 186 } | 186 } |
| 187 | 187 |
| 188 static NEVER_INLINE void partitionsOutOfMemoryUsingLessThan16M() | 188 static NEVER_INLINE void partitionsOutOfMemoryUsingLessThan16M() |
| 189 { | 189 { |
| 190 size_t signature = 16 * 1024 * 1024 - 1; | 190 uint32_t signature = getAllocPageErrorCode(); |
| 191 base::debug::Alias(&signature); | 191 base::debug::Alias(&signature); |
|
sof
2016/02/23 07:27:25
If Alias() makes its (aliased) local variable pers
tasak
2016/02/24 03:53:33
I see.
Done.
| |
| 192 IMMEDIATE_CRASH(); | 192 IMMEDIATE_CRASH(); |
| 193 } | 193 } |
| 194 | 194 |
| 195 void Partitions::handleOutOfMemory() | 195 void Partitions::handleOutOfMemory() |
| 196 { | 196 { |
| 197 volatile size_t totalUsage = totalSizeOfCommittedPages(); | 197 volatile size_t totalUsage = totalSizeOfCommittedPages(); |
| 198 | 198 |
| 199 if (totalUsage >= 2UL * 1024 * 1024 * 1024) | 199 if (totalUsage >= 2UL * 1024 * 1024 * 1024) |
| 200 partitionsOutOfMemoryUsing2G(); | 200 partitionsOutOfMemoryUsing2G(); |
| 201 if (totalUsage >= 1UL * 1024 * 1024 * 1024) | 201 if (totalUsage >= 1UL * 1024 * 1024 * 1024) |
| 202 partitionsOutOfMemoryUsing1G(); | 202 partitionsOutOfMemoryUsing1G(); |
| 203 if (totalUsage >= 512 * 1024 * 1024) | 203 if (totalUsage >= 512 * 1024 * 1024) |
| 204 partitionsOutOfMemoryUsing512M(); | 204 partitionsOutOfMemoryUsing512M(); |
| 205 if (totalUsage >= 256 * 1024 * 1024) | 205 if (totalUsage >= 256 * 1024 * 1024) |
| 206 partitionsOutOfMemoryUsing256M(); | 206 partitionsOutOfMemoryUsing256M(); |
| 207 if (totalUsage >= 128 * 1024 * 1024) | 207 if (totalUsage >= 128 * 1024 * 1024) |
| 208 partitionsOutOfMemoryUsing128M(); | 208 partitionsOutOfMemoryUsing128M(); |
| 209 if (totalUsage >= 64 * 1024 * 1024) | 209 if (totalUsage >= 64 * 1024 * 1024) |
| 210 partitionsOutOfMemoryUsing64M(); | 210 partitionsOutOfMemoryUsing64M(); |
| 211 if (totalUsage >= 32 * 1024 * 1024) | 211 if (totalUsage >= 32 * 1024 * 1024) |
| 212 partitionsOutOfMemoryUsing32M(); | 212 partitionsOutOfMemoryUsing32M(); |
| 213 if (totalUsage >= 16 * 1024 * 1024) | 213 if (totalUsage >= 16 * 1024 * 1024) |
| 214 partitionsOutOfMemoryUsing16M(); | 214 partitionsOutOfMemoryUsing16M(); |
| 215 partitionsOutOfMemoryUsingLessThan16M(); | 215 partitionsOutOfMemoryUsingLessThan16M(); |
| 216 } | 216 } |
| 217 | 217 |
| 218 } // namespace WTF | 218 } // namespace WTF |
| OLD | NEW |