diff options
| author | Ulrik Sverdrup <bluss@users.noreply.github.com> | 2015-07-07 13:50:23 +0200 |
|---|---|---|
| committer | Ulrik Sverdrup <bluss@users.noreply.github.com> | 2015-07-08 19:40:40 +0200 |
| commit | 6ac0ba3c3a1fc20e17923724e1e7635131eb19d6 (patch) | |
| tree | 24e01203766715d1e62275c80453cbc4acbf6974 /src/libstd/lib.rs | |
| parent | 26f0cd5de7f71a0db0bb3857ce49a11cd0f7d876 (diff) | |
| download | rust-6ac0ba3c3a1fc20e17923724e1e7635131eb19d6.tar.gz rust-6ac0ba3c3a1fc20e17923724e1e7635131eb19d6.zip | |
Improve Vec::resize so that it can be used in Read::read_to_end
We needed a more efficient way to zerofill the vector in read_to_end. This to reduce the memory intialization overhead to a minimum. Use the implementation of `std::vec::from_elem` (used for the vec![] macro) for Vec::resize as well. For simple element types like u8, this compiles to memset, so it makes Vec::resize much more efficient.
Diffstat (limited to 'src/libstd/lib.rs')
| -rw-r--r-- | src/libstd/lib.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index 73e45619774..caf3f497e10 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -146,6 +146,7 @@ #![feature(unique)] #![feature(unsafe_no_drop_flag, filling_drop)] #![feature(vec_push_all)] +#![feature(vec_resize)] #![feature(wrapping)] #![feature(zero_one)] #![cfg_attr(windows, feature(str_utf16))] |
