Skip to content

Light cleanup of the kevent backend. #548

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

Closed
wants to merge 1 commit into from

Conversation

3405691582
Copy link
Member

Some functionality requires particular preprocessor feature flags to be
set but errors are raised if they aren't, so the remedy is to put these
behind relevant feature flags.

  • dispatch_kevent_t has a qos field only when DISPATCH_USE_KEVENT_QOS
  • _dispatch_kq_unote_update requires DISPATCH_HAVE_DIRECT_KNOTES as it
    is only called from functions behind this
  • _dispatch_workloop_actions and the associated enum are only used when
    DISPATCH_USE_KEVENT_WORKLOOP.

Some unused variable void casts are removed (guard_ptr and pp), which do
not refer to variables -- these may be upstream merge artefacts.

A type cast is made to match types for _dispatch_bug_kevent_client. This
function is incorrectly placed behind HAVE_MACH in src/init.c, but to
keep the scope and impact of this commit narrow, we will defer that
change.

Since EVFILT_FS is not supported on all kevent implementations, put these
behind an #ifdef. EVFILT_USER also requires similar handling, but since
EVFILT_USER kevents are used intrinsically as part of the functionality,
these will be handled in a separate commit.

Some functionality requires particular preprocessor feature flags to be
set but errors are raised if they aren't, so the remedy is to put these
behind relevant feature flags.
  * dispatch_kevent_t has a qos field only when DISPATCH_USE_KEVENT_QOS
  * _dispatch_kq_unote_update requires DISPATCH_HAVE_DIRECT_KNOTES as it
    is only called from functions behind this
  * _dispatch_workloop_actions and the associated enum are only used when
    DISPATCH_USE_KEVENT_WORKLOOP.

Some unused variable void casts are removed (guard_ptr and pp), which do
not refer to variables -- these may be upstream merge artefacts.

A type cast is made to match types for _dispatch_bug_kevent_client. This
function is incorrectly placed behind HAVE_MACH in src/init.c, but to
keep the scope and impact of this commit narrow, we will defer that
change.

Since EVFILT_FS is not supported on all kevent implementations, put these
behind an #ifdef. EVFILT_USER also requires similar handling, but since
EVFILT_USER kevents are used intrinsically as part of the functionality,
these will be handled in a separate commit.
@3405691582
Copy link
Member Author

cc @ktopley-apple who may find some of this of interest.

@3405691582
Copy link
Member Author

ping.

2 similar comments
@3405691582
Copy link
Member Author

ping.

@3405691582
Copy link
Member Author

ping.

@3405691582
Copy link
Member Author

Closing in favor of #559.

@3405691582 3405691582 closed this Jul 7, 2021
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.

1 participant