Skip to content

Commit ce94fc6

Browse files
author
bors-servo
authored
Auto merge of #43 - mbrubeck:uninit, r=jdm
Don't zero the array on initialization Using `mem::uninitialized` is potentially faster than `mem::zeroed`, and doesn't remove any safety (since both uninitialized memory and zeroed memory are unsafe to read from in general). <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/rust-smallvec/43) <!-- Reviewable:end -->
2 parents f9269da + 4ba8345 commit ce94fc6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ impl<A: Array> SmallVec<A> {
202202
unsafe {
203203
SmallVec {
204204
len: 0,
205-
data: Inline { array: mem::zeroed() },
205+
data: Inline { array: mem::uninitialized() },
206206
}
207207
}
208208
}

0 commit comments

Comments
 (0)