Skip to content
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

Features that require libc #500

Closed
2 tasks done
madsmtm opened this issue Sep 3, 2023 · 3 comments
Closed
2 tasks done

Features that require libc #500

madsmtm opened this issue Sep 3, 2023 · 3 comments
Labels
A-objc2 Affects the `objc2`, `objc2-exception-helper` and/or `objc2-encode` crates
Milestone

Comments

@madsmtm
Copy link
Owner

madsmtm commented Sep 3, 2023

We kinda need to figure out a general policy on how we handle features that require libc (or at least just linking to it).

There are at least two things I'd like to do:

  • Move MainThreadMarker into objc2 (with a more efficient implementation, namely libc::pthread_main_np)
    • Although really convenient, unsure if this is desired to have in objc2? I feel like it belongs in some lower-level library, though we don't have that, so I guess it'll have to be here.
  • The things gated behind malloc support requires libc::free, I'd like to remove that feature gate to be able to verify more things in debug_assertions. Done in Work towards removing malloc_buf #547.
@madsmtm madsmtm added the A-objc2 Affects the `objc2`, `objc2-exception-helper` and/or `objc2-encode` crates label Sep 3, 2023
@madsmtm madsmtm mentioned this issue Sep 3, 2023
80 tasks
@silvanshade
Copy link
Contributor

silvanshade commented Sep 3, 2023

Is there any real downside to using it?

I'm using it in the cxx-auto stuff FWIW, although that would only affect the header-translator.

@madsmtm
Copy link
Owner Author

madsmtm commented Sep 3, 2023

Downside is compilation speed, it's an extra dependency (with a build.rs script).

I'd be fine with using it in icrate, though also there probably behind a feature flag, again because it's an added dependency.

@madsmtm madsmtm modified the milestone: Polish icrate Sep 11, 2023
madsmtm added a commit that referenced this issue Dec 27, 2023
Part of the work required to move `MainThreadMarker` to `objc2` (since `MainThreadMarker::run_on_main` can't easily exist in the `objc2` crate).

CC #500.
madsmtm added a commit that referenced this issue May 10, 2024
@madsmtm madsmtm added this to the objc2 v0.6 milestone May 20, 2024
@madsmtm
Copy link
Owner Author

madsmtm commented Jun 2, 2024

#616 changed the implementation of MainThreadMarker to use pthread_main_np and #625 moves it to objc2.

@madsmtm madsmtm closed this as completed Jun 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-objc2 Affects the `objc2`, `objc2-exception-helper` and/or `objc2-encode` crates
Projects
None yet
Development

No branches or pull requests

2 participants