mirror of
https://github.com/apple/swift-collections
synced 2026-11-28 05:04:21 +00:00
Update Sources/HashTreeCollections/HashNode/_HashTreeStatistics.swift
Co-authored-by: Karoy Lorentey <klorentey@apple.com>
This commit is contained in:
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)
|
||||
|
||||
Reference in new issue
Block a user