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

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

Issue 1841363003: Replace RELEASE_ASSERT_WITH_SECURITY_IMPLICATION with SECURITY_CHECK. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 936 matching lines...) Expand 10 before | Expand all | Expand 10 after
947 ASSERT(!partitionPageGetRawSize(page)); 947 ASSERT(!partitionPageGetRawSize(page));
948 948
949 partitionRegisterEmptyPage(page); 949 partitionRegisterEmptyPage(page);
950 } else { 950 } else {
951 ASSERT(!partitionBucketIsDirectMapped(bucket)); 951 ASSERT(!partitionBucketIsDirectMapped(bucket));
952 // Ensure that the page is full. That's the only valid case if we 952 // Ensure that the page is full. That's the only valid case if we
953 // arrive here. 953 // arrive here.
954 ASSERT(page->numAllocatedSlots < 0); 954 ASSERT(page->numAllocatedSlots < 0);
955 // A transition of numAllocatedSlots from 0 to -1 is not legal, and 955 // A transition of numAllocatedSlots from 0 to -1 is not legal, and
956 // likely indicates a double-free. 956 // likely indicates a double-free.
957 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(page->numAllocatedSlots != -1); 957 SECURITY_CHECK(page->numAllocatedSlots != -1);
958 page->numAllocatedSlots = -page->numAllocatedSlots - 2; 958 page->numAllocatedSlots = -page->numAllocatedSlots - 2;
959 ASSERT(page->numAllocatedSlots == partitionBucketSlots(bucket) - 1); 959 ASSERT(page->numAllocatedSlots == partitionBucketSlots(bucket) - 1);
960 // Fully used page became partially used. It must be put back on the 960 // Fully used page became partially used. It must be put back on the
961 // non-full page list. Also make it the current page to increase the 961 // non-full page list. Also make it the current page to increase the
962 // chances of it being filled up again. The old current page will be 962 // chances of it being filled up again. The old current page will be
963 // the next page. 963 // the next page.
964 ASSERT(!page->nextPage); 964 ASSERT(!page->nextPage);
965 if (LIKELY(bucket->activePagesHead != &PartitionRootGeneric::gSeedPage)) 965 if (LIKELY(bucket->activePagesHead != &PartitionRootGeneric::gSeedPage))
966 page->nextPage = bucket->activePagesHead; 966 page->nextPage = bucket->activePagesHead;
967 bucket->activePagesHead = page; 967 bucket->activePagesHead = page;
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
1402 partitionStats.totalDiscardableBytes += memoryStats[i].discardableBy tes; 1402 partitionStats.totalDiscardableBytes += memoryStats[i].discardableBy tes;
1403 if (!isLightDump) 1403 if (!isLightDump)
1404 partitionStatsDumper->partitionsDumpBucketStats(partitionName, & memoryStats[i]); 1404 partitionStatsDumper->partitionsDumpBucketStats(partitionName, & memoryStats[i]);
1405 } 1405 }
1406 } 1406 }
1407 partitionStatsDumper->partitionDumpTotals(partitionName, &partitionStats); 1407 partitionStatsDumper->partitionDumpTotals(partitionName, &partitionStats);
1408 } 1408 }
1409 1409
1410 } // namespace WTF 1410 } // namespace WTF
1411 1411
OLDNEW
« third_party/WebKit/Source/wtf/Assertions.h ('K') | « third_party/WebKit/Source/wtf/PartitionAlloc.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698