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

Replace mem::uninitialized() with mem::zeroed() #83

Merged
merged 1 commit into from Nov 9, 2019

Conversation

icefoxen
Copy link
Contributor

@icefoxen icefoxen commented Aug 21, 2019

It probably doesn't matter. But really it can only help. It's theoretically a performance malus but it's so tiny to be irrelevant; I have yet to need a program to find out how many CPU's it has more than once.

Safety: all the uses of zeroed() are for C structs that contain integers, raw pointers or c_char only, so it's always valid.

Edit: Hah, I didn't see #82. Either one is good!

It *probably* doesn't matter.  But really it can only help.  It's theoretically a performance malus but it's so tiny to be irrelevant; I have yet to need a program to find out how many CPU's it has more than once.

Safety: all the uses of `zeroed()` are for C structs that contain integers or `c_char` only, so it's always valid.
@RalfJung
Copy link
Contributor

RalfJung commented Nov 9, 2019

@seanmonstar given what you wrote at #90 (comment), would it be possible to merge this?

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.

None yet

3 participants