Skip to content

Cleanup Apple implementation#23

Open
complexspaces wants to merge 4 commits into
jhpratt:mainfrom
complexspaces:apple-imp-cleanup
Open

Cleanup Apple implementation#23
complexspaces wants to merge 4 commits into
jhpratt:mainfrom
complexspaces:apple-imp-cleanup

Conversation

@complexspaces

Copy link
Copy Markdown
Contributor

This PR resolves the confusing type size implications pointed out in a recent report and additionally cleans up the other type casing done inside the Apple implementation to be cleaner. It also handles a trivial libc deprecation I noticed opening up a fresh clone of the repository.

Commit-by-commit review is recommended.

Closes #22

@complexspaces

Copy link
Copy Markdown
Contributor Author

Interestingly, the tests sometimes fail on my MacBook, both on main and this branch:

thread 'main' (10399431) panicked at tests.rs:41:9:
assertion `left == right` failed
  left: Some(false)
 right: Some(true)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

I'm not sure if this is just a fluke or something to be worried about.

The mach APIs used are available and non-restricted on watchOS and visionOS as well
@jhpratt

jhpratt commented Jul 2, 2026

Copy link
Copy Markdown
Owner

That's definitely unexpected. Returning false is always an acceptable answer given the soundness implications. I don't know enough about MacOS to know if there is always another process underneath.

To be totally honest, I don't really need this crate any more, as the only time it's used in the time crate is in a method that is rarely if ever called. So this is not exactly a high priority for me. I very much appreciate you helping out, though! OS-level things aren't my forte.

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.

Soundness: FFI ABI mismatch in mach_vm_deallocate on 32-bit Apple targets

2 participants