From 29cdb59bf906d1fd999ba6300c20e7c1ec8092b3 Mon Sep 17 00:00:00 2001 From: 3405691582 Date: Fri, 2 May 2025 17:04:54 -0400 Subject: [PATCH] Update Sources/HashTreeCollections/HashNode/_HashTreeStatistics.swift Co-authored-by: Karoy Lorentey --- .../HashTreeCollections/HashNode/_HashTreeStatistics.swift | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Sources/HashTreeCollections/HashNode/_HashTreeStatistics.swift b/Sources/HashTreeCollections/HashNode/_HashTreeStatistics.swift index 6d15a735..0dd1efed 100644 --- a/Sources/HashTreeCollections/HashNode/_HashTreeStatistics.swift +++ b/Sources/HashTreeCollections/HashNode/_HashTreeStatistics.swift @@ -115,14 +115,11 @@ extension _HashNode { let objectHeaderSize = 2 * MemoryLayout.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)