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

get rid of unnecessary uses of unsafe #460

Merged
merged 5 commits into from
Oct 25, 2024

Conversation

Freax13
Copy link
Contributor

@Freax13 Freax13 commented Sep 19, 2024

This PR get's rid of some unnecessary uses of unsafe mainly by switching to safe alternatives provided by the zerocopy crate.

@joergroedel joergroedel added the in-review PR is under active review and not yet approved label Sep 26, 2024
It turns out all of our uses of unsafe in this module can be trivally
replaced by uses of the zerocopy crate.

Signed-off-by: Tom Dohrmann <[email protected]>
Once again, zerocopy can do everything we needed without us using
unsafe.

Signed-off-by: Tom Dohrmann <[email protected]>
The new implementation is much shorter, should perform exactly the same
and doesn't even rely on unsafe.

Signed-off-by: Tom Dohrmann <[email protected]>
zerocopy is great :)

Signed-off-by: Tom Dohrmann <[email protected]>
We can make use of the `Deref` and `DerefMut` implementations.

Signed-off-by: Tom Dohrmann <[email protected]>
@joergroedel joergroedel merged commit 787283d into coconut-svsm:main Oct 25, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in-review PR is under active review and not yet approved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants