Skip to content

wineserver: cache the client thread's Mach send right in send_thread_signal (ml2310) - #656

Open
TimmyTurner51 wants to merge 1 commit into
willfaust:mainfrom
TimmyTurner51:pr/wineserver-sendport-cache
Open

TimmyTurner51 wants to merge 1 commit into
willfaust:mainfrom
TimmyTurner51:pr/wineserver-sendport-cache

Conversation

@TimmyTurner51

Copy link
Copy Markdown

Summary

Caches the client thread's Mach control port send right on struct thread (ios_send_port, appended at the end of the WINE_IOS block to preserve prebuilt libwineserver.a ABI offsets), eliminating per-wake mach_port_extract_right + mach_port_deallocate Mach IPC pairs in build/wineserver/mach_ios.c:

  • Derived once on first send_thread_signal() call, reused on subsequent wakes, and released in destroy_thread() (and on ESRCH if the thread died).
  • Explicitly initialized to 0 because mem_alloc() poisons with 0x55.
  • Includes the matching wine submodule patch build/wine-patches/0007-wineserver-sendport-cache.patch and host gate tests/host/check-wineserver-sendport-cache.py (which also guards that build/wineserver/build.sh still builds mach_ios.c).

Verification

  • tests/host/check-wineserver-sendport-cache.py: PASS (mutation-tested 3 ways: unconditional extract, missing initializer, missing release).
  • Measured on-device on iPhone 17 Pro (Forza Horizon 6, packaged as unixhalf-ml2310-sendport-native.wcp).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants