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

Side by Side Diff: third_party/WebKit/Source/wtf/allocator/PartitionAlloc.cpp

Issue 2130293003: Change OOMs to raise custom exception rather than breakpoint on Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments Created 4 years, 5 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
OLDNEW
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 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 PartitionBucket* bucket = &root->buckets[i]; 301 PartitionBucket* bucket = &root->buckets[i];
302 foundLeak |= partitionAllocShutdownBucket(bucket); 302 foundLeak |= partitionAllocShutdownBucket(bucket);
303 } 303 }
304 foundLeak |= partitionAllocBaseShutdown(root); 304 foundLeak |= partitionAllocBaseShutdown(root);
305 return !foundLeak; 305 return !foundLeak;
306 } 306 }
307 307
308 #if !CPU(64BIT) 308 #if !CPU(64BIT)
309 static NEVER_INLINE void partitionOutOfMemoryWithLotsOfUncommitedPages() 309 static NEVER_INLINE void partitionOutOfMemoryWithLotsOfUncommitedPages()
310 { 310 {
311 IMMEDIATE_CRASH(); 311 OOM_CRASH();
312 } 312 }
313 #endif 313 #endif
314 314
315 static NEVER_INLINE void partitionOutOfMemory(const PartitionRootBase* root) 315 static NEVER_INLINE void partitionOutOfMemory(const PartitionRootBase* root)
316 { 316 {
317 #if !CPU(64BIT) 317 #if !CPU(64BIT)
318 // Check whether this OOM is due to a lot of super pages that are allocated 318 // Check whether this OOM is due to a lot of super pages that are allocated
319 // but not committed, probably due to http://crbug.com/421387. 319 // but not committed, probably due to http://crbug.com/421387.
320 if (root->totalSizeOfSuperPages + root->totalSizeOfDirectMappedPages - root- >totalSizeOfCommittedPages > kReasonableSizeOfUnusedPages) { 320 if (root->totalSizeOfSuperPages + root->totalSizeOfDirectMappedPages - root- >totalSizeOfCommittedPages > kReasonableSizeOfUnusedPages) {
321 partitionOutOfMemoryWithLotsOfUncommitedPages(); 321 partitionOutOfMemoryWithLotsOfUncommitedPages();
322 } 322 }
323 #endif 323 #endif
324 if (PartitionRootBase::gOomHandlingFunction) 324 if (PartitionRootBase::gOomHandlingFunction)
325 (*PartitionRootBase::gOomHandlingFunction)(); 325 (*PartitionRootBase::gOomHandlingFunction)();
326 IMMEDIATE_CRASH(); 326 OOM_CRASH();
327 } 327 }
328 328
329 static NEVER_INLINE void partitionExcessiveAllocationSize() 329 static NEVER_INLINE void partitionExcessiveAllocationSize()
330 { 330 {
331 IMMEDIATE_CRASH(); 331 OOM_CRASH();
332 } 332 }
333 333
334 static NEVER_INLINE void partitionBucketFull() 334 static NEVER_INLINE void partitionBucketFull()
335 { 335 {
336 IMMEDIATE_CRASH(); 336 OOM_CRASH();
337 } 337 }
338 338
339 // partitionPageStateIs* 339 // partitionPageStateIs*
340 // Note that it's only valid to call these functions on pages found on one of 340 // Note that it's only valid to call these functions on pages found on one of
341 // the page lists. Specifically, you can't call these functions on full pages 341 // the page lists. Specifically, you can't call these functions on full pages
342 // that were detached from the active list. 342 // that were detached from the active list.
343 static bool ALWAYS_INLINE partitionPageStateIsActive(const PartitionPage* page) 343 static bool ALWAYS_INLINE partitionPageStateIsActive(const PartitionPage* page)
344 { 344 {
345 ASSERT(page != &PartitionRootGeneric::gSeedPage); 345 ASSERT(page != &PartitionRootGeneric::gSeedPage);
346 ASSERT(!page->pageOffset); 346 ASSERT(!page->pageOffset);
(...skipping 1058 matching lines...) Expand 10 before | Expand all | Expand 10 after
1405 partitionStats.totalDiscardableBytes += memoryStats[i].discardableBy tes; 1405 partitionStats.totalDiscardableBytes += memoryStats[i].discardableBy tes;
1406 if (!isLightDump) 1406 if (!isLightDump)
1407 partitionStatsDumper->partitionsDumpBucketStats(partitionName, & memoryStats[i]); 1407 partitionStatsDumper->partitionsDumpBucketStats(partitionName, & memoryStats[i]);
1408 } 1408 }
1409 } 1409 }
1410 partitionStatsDumper->partitionDumpTotals(partitionName, &partitionStats); 1410 partitionStatsDumper->partitionDumpTotals(partitionName, &partitionStats);
1411 } 1411 }
1412 1412
1413 } // namespace WTF 1413 } // namespace WTF
1414 1414
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/wtf/Assertions.h ('k') | third_party/WebKit/Source/wtf/allocator/Partitions.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698