| 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 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 682 size_t rawSize = partitionPageGetRawSize(page); | 682 size_t rawSize = partitionPageGetRawSize(page); |
| 683 if (rawSize) | 683 if (rawSize) |
| 684 slotSize = rawSize; | 684 slotSize = rawSize; |
| 685 partitionCookieCheckValue(ptr); | 685 partitionCookieCheckValue(ptr); |
| 686 partitionCookieCheckValue(reinterpret_cast<char*>(ptr) + slotSize - kCookieS
ize); | 686 partitionCookieCheckValue(reinterpret_cast<char*>(ptr) + slotSize - kCookieS
ize); |
| 687 memset(ptr, kFreedByte, slotSize); | 687 memset(ptr, kFreedByte, slotSize); |
| 688 #endif | 688 #endif |
| 689 ASSERT(page->numAllocatedSlots); | 689 ASSERT(page->numAllocatedSlots); |
| 690 PartitionFreelistEntry* freelistHead = page->freelistHead; | 690 PartitionFreelistEntry* freelistHead = page->freelistHead; |
| 691 ASSERT(!freelistHead || partitionPointerIsValid(freelistHead)); | 691 ASSERT(!freelistHead || partitionPointerIsValid(freelistHead)); |
| 692 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(ptr != freelistHead); // Catches an
immediate double free. | 692 SECURITY_CHECK(ptr != freelistHead); // Catches an immediate double free. |
| 693 ASSERT_WITH_SECURITY_IMPLICATION(!freelistHead || ptr != partitionFreelistMa
sk(freelistHead->next)); // Look for double free one level deeper in debug. | 693 ASSERT_WITH_SECURITY_IMPLICATION(!freelistHead || ptr != partitionFreelistMa
sk(freelistHead->next)); // Look for double free one level deeper in debug. |
| 694 PartitionFreelistEntry* entry = static_cast<PartitionFreelistEntry*>(ptr); | 694 PartitionFreelistEntry* entry = static_cast<PartitionFreelistEntry*>(ptr); |
| 695 entry->next = partitionFreelistMask(freelistHead); | 695 entry->next = partitionFreelistMask(freelistHead); |
| 696 page->freelistHead = entry; | 696 page->freelistHead = entry; |
| 697 --page->numAllocatedSlots; | 697 --page->numAllocatedSlots; |
| 698 if (UNLIKELY(page->numAllocatedSlots <= 0)) { | 698 if (UNLIKELY(page->numAllocatedSlots <= 0)) { |
| 699 partitionFreeSlowPath(page); | 699 partitionFreeSlowPath(page); |
| 700 } else { | 700 } else { |
| 701 // All single-slot allocations must go through the slow path to | 701 // All single-slot allocations must go through the slow path to |
| 702 // correctly update the size metadata. | 702 // correctly update the size metadata. |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 869 using WTF::partitionAlloc; | 869 using WTF::partitionAlloc; |
| 870 using WTF::partitionFree; | 870 using WTF::partitionFree; |
| 871 using WTF::partitionAllocGeneric; | 871 using WTF::partitionAllocGeneric; |
| 872 using WTF::partitionFreeGeneric; | 872 using WTF::partitionFreeGeneric; |
| 873 using WTF::partitionReallocGeneric; | 873 using WTF::partitionReallocGeneric; |
| 874 using WTF::partitionAllocActualSize; | 874 using WTF::partitionAllocActualSize; |
| 875 using WTF::partitionAllocSupportsGetSize; | 875 using WTF::partitionAllocSupportsGetSize; |
| 876 using WTF::partitionAllocGetSize; | 876 using WTF::partitionAllocGetSize; |
| 877 | 877 |
| 878 #endif // WTF_PartitionAlloc_h | 878 #endif // WTF_PartitionAlloc_h |
| OLD | NEW |