Skip to content

Commit 8e21fff

Browse files
committed
Add comment
1 parent 6bc0aa3 commit 8e21fff

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

FirebaseCore/Internal/Sources/HeartbeatLogging/HeartbeatStorage.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,19 @@ final class HeartbeatStorage: HeartbeatStorageProtocol {
5252

5353
/// Statically allocated cache of `HeartbeatStorage` instances keyed by string IDs.
5454
#if compiler(>=6)
55+
// In Swift 6, this property is not concurrency-safe because it is
56+
// nonisolated global shared mutable state. Because this target's
57+
// deployment version does not support Swift concurrency, it is marked as
58+
// `nonisolated(unsafe)` to disable concurrency-safety checks. The
59+
// property's access is protected by an external synchronization mechanism
60+
// (see `instancesLock` property).
5561
private nonisolated(unsafe) static var cachedInstances: [
5662
String: WeakContainer<HeartbeatStorage>
5763
] =
5864
[:]
5965
#else
66+
// TODO(Xcode 16): Delete this block when minimum supported Xcode is
67+
// Xcode 16.
6068
private static var cachedInstances: [
6169
String: WeakContainer<HeartbeatStorage>
6270
] =

0 commit comments

Comments
 (0)