Update Sources/HashTreeCollections/HashNode/_HashTreeStatistics.swift

Co-authored-by: Karoy Lorentey <klorentey@apple.com>
This commit is contained in:
3405691582andKaroy Lorentey authored and Karoy Lorentey committed 2025-05-16 00:21:38 -07:00
1 parent 8bbbe287c3
commit 29cdb59bf9
1 file changed
+1 -4
@@ -115,14 +115,11 @@ extension _HashNode {
let objectHeaderSize = 2 * MemoryLayout<Int>.stride
#if !os(OpenBSD)
// Note: for simplicity, we assume that there is no padding between
// the object header and the storage header.
let start = _getUnsafePointerToStoredProperties(self.raw.storage)
let capacity = self.raw.storage.capacity
let end = $0._memory + capacity * MemoryLayout<_RawHashNode>.stride
let end = $0._memory + $0.byteCapacity
stats.grossBytes += objectHeaderSize + (end - start)
#endif
for child in $0.children {
child.gatherStatistics(level.descend(), &stats)