MCPcopy Create free account
hub / github.com/davidgiven/fluxengine / calculateSize

Method calculateSize

lib/data/image.cc:74–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72}
73
74void Image::calculateSize()
75{
76 _geometry = {};
77 unsigned maxSector = 0;
78 for (const auto& i : _sectors)
79 {
80 const auto& sector = i.second;
81 if (sector)
82 {
83 _geometry.numCylinders = std::max(
84 _geometry.numCylinders, (unsigned)sector->logicalCylinder + 1);
85 _geometry.numHeads =
86 std::max(_geometry.numHeads, (unsigned)sector->logicalHead + 1);
87 _geometry.firstSector = std::min(
88 _geometry.firstSector, (unsigned)sector->logicalSector);
89 maxSector = std::max(maxSector, (unsigned)sector->logicalSector);
90 _geometry.sectorSize =
91 std::max(_geometry.sectorSize, sector->data.size());
92 _geometry.totalBytes += _geometry.sectorSize;
93 }
94 }
95 _geometry.numSectors = maxSector - _geometry.firstSector + 1;
96}
97
98void Image::populateSectorPhysicalLocationsFromLogicalLocations(
99 const DiskLayout& diskLayout)

Callers 11

readImageMethod · 0.80
readImageMethod · 0.80
readImageMethod · 0.80
readImageMethod · 0.80
readImageMethod · 0.80
readImageMethod · 0.80
readImageMethod · 0.80
readImageMethod · 0.80
readImageMethod · 0.80
readCsvFunction · 0.80
wtMakeDiskDataFromImageFunction · 0.80

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected