macOS 13 uses NSTaggedPointerString for short CFStrings
which means the retain counts aren't meaningful. Increasing the length
of the strings avoids this.
Empty arrays also seem to refer to a shared constant object that
doesn't have meaningful retain counts either.
Fixes#597
This test was failing intermittently on github actions.
There's no safe way to check that a file descriptor has been closed,
because a new file could have been reopened with the same number. We'd
then end up closing that new file instead of having close() fail.
Adds run_in_mode wrapper over CFRunLoopRunInMode
Adds a `run_in_mode` wrapper function which just makes `CFRunLoopRunInMode` a little more "rusty".
Also adds a `CFRunLoopRunResult` enum to type the return value.
Add a `name` method to `CFTimeZone` to get the time zone ID (e.g.,
"America/Los_Angeles") of the current time zone.
Core Foundation calls this "name" instead of "id" in its method
signatures, but acknowledges it in the closely-related NSTimeZone
related docs. Since most of the other methods in this library match
closely with CF naming, also use `name` here.
> Time zone database entries such as “America/Los_Angeles” are IDs, not
> names. An example of a time zone name is “Pacific Daylight Time”.
> Although many NSTimeZone symbols include the word “name”, they
> actually refer to IDs.
Fix CFRunLoop types to avoid UB
A number of callback functions associated with the CFRunLoop types are
allowed to be NULL to evoke default behavior.
Prior to this commit the definition of those structs prevented passing
in null which meant resorting to transmute or other tricks to
effectively set null, but with recent compiler versions the compiler
emits `ud2` instructions and triggers a fault at runtime.
The correct resolution for this is to define these fields as `Option`al
callbacks and that is what this commit does.
I've used this approach successfully here in another project:
Refs: https://github.com/wez/wezterm/commit/398f333c32fb1ff4ccd9cc001a66ae22522eb60c
I've bumped up the version for the crate as part of this commit
because it effectively changes the API around these structs.
A number of callback functions associated with the CFRunLoop types are
allowed to be NULL to evoke default behavior.
Prior to this commit the definition of those structs prevented passing
in null which meant resorting to transmute or other tricks to
effectively set null, but with recent compiler versions the compiler
emits `ud2` instructions and triggers a fault at runtime.
The correct resolution for this is to define these fields as `Option`al
callbacks and that is what this commit does.
I've used this approach successfully here in another project:
Refs: https://github.com/wez/wezterm/commit/398f333c32fb1ff4ccd9cc001a66ae22522eb60c
I've bumped up the version for the crate as part of this commit
because it effectively changes the API around these structs.