Skip to content

Use zerocopy instead of unsafe transmute#51

Merged
allisonkarlitskaya merged 1 commit into
composefs:mainfrom
cgwalters:use-zerocopy
Dec 5, 2024
Merged

Use zerocopy instead of unsafe transmute#51
allisonkarlitskaya merged 1 commit into
composefs:mainfrom
cgwalters:use-zerocopy

Conversation

@cgwalters
Copy link
Copy Markdown
Collaborator

@cgwalters cgwalters commented Dec 5, 2024

Followup to #50


ref https://lwn.net/Articles/995814/ etc.

I also did a PR for tar-rs: composefs/tar-rs#392

Thanks to the maintainer who helped me on Discord
to know the right API to call here.

ref https://lwn.net/Articles/995814/ etc.

I also did a PR for tar-rs: composefs/tar-rs#392

Thanks to the maintainer who helped me on Discord
to know the right API to call here.

Signed-off-by: Colin Walters <walters@verbum.org>
Comment thread src/fs.rs

let mut buffer = [0; 65536];
for name in names.split_inclusive(|c| *c == 0) {
// SAFETY: casting i8 to u8 is safe.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

@allisonkarlitskaya allisonkarlitskaya merged commit 5049efb into composefs:main Dec 5, 2024
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.

2 participants