You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the standard library's Shims.swift, there are these declarations:
/// A dummy value to be used as the target for `mutationsPtr` in fast
/// enumeration implementations.
internal var _fastEnumerationStorageMutationsTarget: CUnsignedLong = 0
/// A dummy pointer to be used as `mutationsPtr` in fast enumeration
/// implementations.
public // SPI(Foundation)
var _fastEnumerationStorageMutationsPtr: UnsafeMutablePointer<CUnsignedLong> {
return UnsafeMutablePointer(
Builtin.addressof(&_fastEnumerationStorageMutationsTarget))
}
There's no reason to expose this publicly. The way NSFastEnumeration works, the mutationsPtr either points to a word-sized chunk of memory that will change if the collection is mutated (to catch mutation-while-iterating bugs), or it points to some constant memory. That means the standard library and the Foundation overlay can each use the address of their own global variable if they don't want to bother checking for mutations, and they don't need a wrapper function to do it.
The text was updated successfully, but these errors were encountered:
Additional Detail from JIRA
md5: 9bb9fcf2a83ea5b9efb2c46f78f1009d
Issue Description:
In the standard library's Shims.swift, there are these declarations:
There's no reason to expose this publicly. The way NSFastEnumeration works, the
mutationsPtr
either points to a word-sized chunk of memory that will change if the collection is mutated (to catch mutation-while-iterating bugs), or it points to some constant memory. That means the standard library and the Foundation overlay can each use the address of their own global variable if they don't want to bother checking for mutations, and they don't need a wrapper function to do it.The text was updated successfully, but these errors were encountered: