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

Statically find msgSend functions on apple devices #15

Merged
merged 1 commit into from
Sep 2, 2021

Conversation

madsmtm
Copy link
Owner

@madsmtm madsmtm commented Sep 1, 2021

The functions are found by looking at the Encode::ENCODING and size of the return type.

This ensures that we don't incur a performance overhead for that (though we probably didn't before anyways).

This is also more correct since it allows the following:

#[repr(transparent)]
struct Wrapper {
    inner: f32,
}
unsafe impl Encode for Wrapper {
    const ENCODING: Encoding<'static> = f32::ENCODING;
}

To use the correct msgSend implementation.

@madsmtm madsmtm added the enhancement New feature or request label Sep 1, 2021
This ensures that we don't incur performance overhead for that (though we probably didn't before anyways).

This is also more correct since it allows the following:
#[repr(transparent)]
struct Wrapper {
    inner: f32,
}
unsafe impl Encode for Wrapper {
    const ENCODING: Encoding<'static> = f32::ENCODING;
}
@madsmtm madsmtm merged commit de78ed4 into master Sep 2, 2021
@madsmtm madsmtm deleted the static-msg-send branch September 2, 2021 11:12
@madsmtm madsmtm mentioned this pull request Sep 5, 2021
80 tasks
@madsmtm madsmtm added this to the objc2 v0.3 milestone Apr 2, 2022
@madsmtm madsmtm added the I-unsound A soundness hole label Nov 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request I-unsound A soundness hole
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant