File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Sources/Testing/SourceAttribution Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -81,9 +81,17 @@ public struct Backtrace: Sendable {
8181#endif
8282
8383 let endIndex = addresses. index ( addresses. startIndex, offsetBy: initializedCount)
84- return addresses [ ..< endIndex] . withMemoryRebound ( to: UnsafeRawPointer ? . self) { addresses in
84+ #if _pointerBitWidth(_64)
85+ // The width of a pointer equals the width of an `Address`, so we can just
86+ // bitcast the memory rather than mapping through UInt first.
87+ return addresses [ ..< endIndex] . withMemoryRebound ( to: Address . self) { addresses in
8588 Self ( addresses: addresses)
8689 }
90+ #else
91+ return addresses [ ..< endIndex] . withMemoryRebound ( to: UnsafeRawPointer ? . self) { addresses in
92+ return Self ( addresses: addresses)
93+ }
94+ #endif
8795 }
8896 }
8997}
You can’t perform that action at this time.
0 commit comments