-
Notifications
You must be signed in to change notification settings - Fork 229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make CFRunLoopMode a safe wrapper with a lifetime #650
base: main
Are you sure you want to change the base?
Conversation
57cbb3b
to
a37e70c
Compare
Hello! Sorry for the long delay. Would you be able to rebase this forward and fix the merge conflicts? If so, we'd like to review it and see about landing it. |
a37e70c
to
8118d6a
Compare
Rebased |
Clippy doesn't like methods called
so I renamed the constructors to |
I think the naming, while redundant, is fine. |
0c732c1
to
db98303
Compare
Pushed again to fix (FYI, there's a GitHub Actions setting for "Require approval for first-time contributors who are new to GitHub" that is less annoying than the default "Require approval for first-time contributors ") |
Fixes #648: the safe methods that take
CFRunLoopMode
are currently unsound because it is a raw pointer that is not necessarily valid.As a bonus, this allows use of
kCFRunLoopCommonModes
andkCFRunLoopDefaultMode
constants withoutunsafe
.I considered just making
mode
a&CFString
, but it seems that the implementation compares the pointer values, so this way ensures that the constants are passed as the pointers it expects. I don't understand the purpose or usage ofmode
very well, so correct me if this is not ideal.