MCPcopy Create free account
hub / github.com/KDE/kdevelop / lostSpace

Method lostSpace

kdevplatform/serialization/itemrepository.h:897–921  ·  view source on GitHub ↗

Counts together the space that is neither accessible through m_objectMap nor through the free items

Source from the content-addressed store, hash-verified

895
896 //Counts together the space that is neither accessible through m_objectMap nor through the free items
897 uint lostSpace()
898 {
899 if (m_monsterBucketExtent)
900 return 0;
901
902 uint need = ItemRepositoryBucketSize - m_available;
903 uint found = 0;
904
905 for (uint a = 0; a < ObjectMapSize; ++a) {
906 uint currentIndex = m_objectMap[a];
907 while (currentIndex) {
908 found += reinterpret_cast<const Item*>(m_data + currentIndex)->itemSize() + AdditionalSpacePerItem;
909
910 currentIndex = followerIndex(currentIndex);
911 }
912 }
913
914 uint currentIndex = m_largestFreeItem;
915 while (currentIndex) {
916 found += freeSize(currentIndex) + AdditionalSpacePerItem;
917
918 currentIndex = followerIndex(currentIndex);
919 }
920 return need - found;
921 }
922
923private:
924

Callers 1

statisticsMethod · 0.80

Calls 1

itemSizeMethod · 0.45

Tested by

no test coverage detected