Conversation
Cargo.toml
Outdated
| # Branch: objc2 | ||
| cocoa = { git = "https://github.com/madsmtm/core-foundation-rs.git", rev = "8e6c4854de2408ed1e3e614dbe6f9f2762bde7c3" } | ||
| core-foundation = { git = "https://github.com/madsmtm/core-foundation-rs.git", rev = "8e6c4854de2408ed1e3e614dbe6f9f2762bde7c3" } | ||
| core-graphics = { git = "https://github.com/madsmtm/core-foundation-rs.git", rev = "8e6c4854de2408ed1e3e614dbe6f9f2762bde7c3" } |
There was a problem hiding this comment.
This is only in the interim; once #2427 is fully merged, the need for this will be gone
CHANGELOG.md
Outdated
|
|
||
| # Unreleased | ||
|
|
||
| - **Breaking:** Bump MSRV from `1.57` to `1.60`. |
There was a problem hiding this comment.
Note that objc2 doesn't have a MSRV policy yet, see madsmtm/objc2#203.
But since we use a pinned dependency, this shouldn't be a problem (yet).
806722f to
4a7e9d7
Compare
kchibisov
left a comment
There was a problem hiding this comment.
I don't have that much to say, given that I have no clue about the objc internals. The changes look good, some minor notes.
|
|
||
| impl MonitorHandle { | ||
| pub fn retained_new(uiscreen: id) -> MonitorHandle { | ||
| assert_main_thread!("`MonitorHandle` can only be cloned on the main thread on iOS"); |
There was a problem hiding this comment.
This has nothing to do with that PR, but could libdispatch used to drop from the main thread? So we won't have runtime panics like that? Though I think the issue that you can't use that from the other thread as well?
It just all looks wrong to me. We say that winit window is Send and you can get MonitorHandle from the Window(owning one iirc), but when you drop it you'll panic?
There was a problem hiding this comment.
There is so much thread-unsafety in our macOS (and probably also iOS, but less well-versed in that) implementation, really, you have no idea!
Anyway, to answer your question: Yes, we could and should use libdispatch to do things on the main thread, both here and in a lot of other places. I'm in the process of exploring solutions, have focused on objc2 stuff first though.
58f3022 to
34fb9ad
Compare
34fb9ad to
f41d459
Compare
Move to
objc2, my fork ofobjcwhich adds a lot of things, in particular macros for proper memory management, and a lot of fixed soundness issues.Split out from of #2427.
Concrete improvements in
objc2which can be seen in this PR:msg_send!can now returnboolwithout special handling.msg_send!are now required to beEncode. This helped catching a lot of undefined behaviour, which are fixed in Fix some invalidmsg_send!usage #2138 and iOS: Fix a few instances of UB #2428.Checklist:
CHANGELOG.mdif knowledge of this change could be valuable to users