Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Remove needless unsafe from Buffer::from_{data,iter} #2196

Merged
merged 1 commit into from
Apr 29, 2023

Conversation

marc0246
Copy link
Contributor

This must have been some relic that was never touched while things around it were refactored. I'm positive this unsafe is not needed and it might confuse users that are looking at how the library does things. I also checked the assembly and there's no change it seems.

It might be worth investigating why the assembly is so bloated but that's a different issue. Switching from an owned array to a borrowed one as the source makes it generate a memcpy. Note that in the throughput measurements I did in #2076, a memcpy was actually slightly slower than no memcpy, so that's something to consider as we're working with mapped memory and things don't always work as expected.

@Rua Rua merged commit ea86415 into vulkano-rs:master Apr 29, 2023
@marc0246 marc0246 deleted the buffer-constructors-unsafe branch April 29, 2023 13:59
hakolao pushed a commit to hakolao/vulkano that referenced this pull request Feb 20, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants