| 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 1061 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1072 return; | 1072 return; |
| 1073 | 1073 |
| 1074 memset(statsOut, '\0', sizeof(*statsOut)); | 1074 memset(statsOut, '\0', sizeof(*statsOut)); |
| 1075 statsOut->isValid = true; | 1075 statsOut->isValid = true; |
| 1076 statsOut->isDirectMap = false; | 1076 statsOut->isDirectMap = false; |
| 1077 statsOut->numFullPages = static_cast<size_t>(bucket->numFullPages); | 1077 statsOut->numFullPages = static_cast<size_t>(bucket->numFullPages); |
| 1078 statsOut->bucketSlotSize = bucket->slotSize; | 1078 statsOut->bucketSlotSize = bucket->slotSize; |
| 1079 uint16_t bucketNumSlots = partitionBucketSlots(bucket); | 1079 uint16_t bucketNumSlots = partitionBucketSlots(bucket); |
| 1080 size_t bucketUsefulStorage = statsOut->bucketSlotSize * bucketNumSlots; | 1080 size_t bucketUsefulStorage = statsOut->bucketSlotSize * bucketNumSlots; |
| 1081 statsOut->allocatedPageSize = partitionBucketBytes(bucket); | 1081 statsOut->allocatedPageSize = partitionBucketBytes(bucket); |
| 1082 statsOut->pageWasteSize = statsOut->allocatedPageSize - bucketUsefulStorage; | |
| 1083 statsOut->activeBytes = bucket->numFullPages * bucketUsefulStorage; | 1082 statsOut->activeBytes = bucket->numFullPages * bucketUsefulStorage; |
| 1084 statsOut->residentBytes = bucket->numFullPages * statsOut->allocatedPageSize
; | 1083 statsOut->residentBytes = bucket->numFullPages * statsOut->allocatedPageSize
; |
| 1085 | 1084 |
| 1086 for (const PartitionPage* page = bucket->emptyPagesHead; page; page = page->
nextPage) { | 1085 for (const PartitionPage* page = bucket->emptyPagesHead; page; page = page->
nextPage) { |
| 1087 // Currently, only decommitted pages appear in the empty pages list. | 1086 // Currently, only decommitted pages appear in the empty pages list. |
| 1088 // This may change. | 1087 // This may change. |
| 1089 ASSERT(page != &PartitionRootGeneric::gSeedPage); | 1088 ASSERT(page != &PartitionRootGeneric::gSeedPage); |
| 1090 ASSERT(!page->freelistHead); | 1089 ASSERT(!page->freelistHead); |
| 1091 ASSERT(!page->numAllocatedSlots); | 1090 ASSERT(!page->numAllocatedSlots); |
| 1092 ASSERT(!page->numUnprovisionedSlots); | 1091 ASSERT(!page->numUnprovisionedSlots); |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1165 // partitionsDumpBucketStats is called after collecting stats because it | 1164 // partitionsDumpBucketStats is called after collecting stats because it |
| 1166 // can use PartitionAlloc to allocate and this can affect the statistics. | 1165 // can use PartitionAlloc to allocate and this can affect the statistics. |
| 1167 for (size_t i = 0; i < partitionNumBuckets; ++i) { | 1166 for (size_t i = 0; i < partitionNumBuckets; ++i) { |
| 1168 if (memoryStats[i].isValid) | 1167 if (memoryStats[i].isValid) |
| 1169 partitionStatsDumper->partitionsDumpBucketStats(partitionName, &memo
ryStats[i]); | 1168 partitionStatsDumper->partitionsDumpBucketStats(partitionName, &memo
ryStats[i]); |
| 1170 } | 1169 } |
| 1171 } | 1170 } |
| 1172 | 1171 |
| 1173 } // namespace WTF | 1172 } // namespace WTF |
| 1174 | 1173 |
| OLD | NEW |