Fix storage usage peer stats

This commit is contained in:
Isaac 2024-10-21 20:29:33 +04:00
parent 219c0231e7
commit f9b5bbf419

View File

@ -348,9 +348,11 @@ public final class StorageBox {
currentSize = 0
}
withUnsafeMutablePointer(to: &currentSize, { pointer in
self.valueBox.set(self.peerContentTypeStatsTable, key: key, value: MemoryBuffer(memory: UnsafeMutableRawPointer(pointer), capacity: 8, length: 8, freeWhenDone: false))
})
withExtendedLifetime(key, {
withUnsafeMutablePointer(to: &currentSize, { pointer in
self.valueBox.set(self.peerContentTypeStatsTable, key: key, value: MemoryBuffer(memory: UnsafeMutableRawPointer(pointer), capacity: 8, length: 8, freeWhenDone: false))
})
}
}
func internalAdd(reference: Reference, to id: Data, contentType: UInt8, size: Int64?) {