Update MovableLock SPI implementation#870
Conversation
🤖 Augment PR SummarySummary: This PR refactors the MovableLock SPI to match the SwiftUICore 6.5.4 layout/symbol surface and updates Swift call sites accordingly. Changes:
Technical Notes: The changes aim to preserve C symbol names while refining the Swift-facing API and matching observed assembly behavior. 🤖 Was this summary useful? React with 👍 or 👎 |
| pthread_mutex_lock(&lock->mutex); | ||
| while (lock->owner) { | ||
| while (lock->owner_thread) { | ||
| [[clang::noinline]] |
There was a problem hiding this comment.
Sources/OpenSwiftUI_SPI/Util/MovableLock.c:68: [[clang::noinline]] is used as a standalone statement attribute here; depending on the C standard/toolchain this can be rejected or downgraded to a warning (which may become an error under -Werror). If the intent is to prevent inlining, it’s safer to ensure noinline is applied in a compiler-supported way for C (also applies to the other occurrences in this PR).
Severity: medium
Other Locations
Sources/OpenSwiftUI_SPI/Util/MovableLock.c:124Sources/OpenSwiftUI_SPI/Util/MovableLock.c:169Sources/OpenSwiftUI_SPI/Util/MovableLock.c:172
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| OPENSWIFTUI_EXPORT | ||
| OPENSWIFTUI_REFINED_FOR_SWIFT | ||
| MovableLock _MovableLockCreate(void) OPENSWIFTUI_SWIFT_NAME(MovableLock.create()); | ||
| MovableLock _MovableLockCreate(void) OPENSWIFTUI_SWIFT_NAME(MovableLock.init()); |
There was a problem hiding this comment.
Sources/OpenSwiftUI_SPI/Util/MovableLock.h:33: Removing OPENSWIFTUI_EXPORT from these declarations may change DLL import/export behavior on Windows (OPENSWIFTUI_EXPORT maps to __declspec(dllexport/dllimport) there). If OpenSwiftUI_SPI is ever built as a Windows DLL, it’s worth double-checking that these C symbols remain exported as intended.
Severity: low
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #870 +/- ##
==========================================
- Coverage 25.73% 25.72% -0.02%
==========================================
Files 677 677
Lines 47008 47008
==========================================
- Hits 12097 12091 -6
- Misses 34911 34917 +6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
/uitest |
Agent Summary
_MovableLockCreateasMovableLock.init()and update call sites/tests