rust/src/libstd/io
Manish Goregaokar abd747cd15 Rollup merge of #23847 - bcoopers:read_clarification, r=sfackler
This introduces no functional changes except for reducing a few unnecessary operations and variables.  Vec has the behavior that, if you request space past the capacity with reserve(), it will round up to the nearest power of 2.  What that effectively means is that after the first call to reserve(16), we are doubling our capacity every time.  So using the DEFAULT_BUF_SIZE and doubling cap_size() here is meaningless and has no effect on the call to reserve().

Note that with #23842 implemented this will hopefully have a clearer API and less of a need for commenting.  If #23842 is not implemented then the most clear implementation would be to call reserve_exact(buf.capacity()) at every step (and making sure that buf.capacity() is not zero at the beginning of the function of course).

Edit- functional change now introduced.  We will now zero 16 bytes of the vector first, then double to 32, then 64, etc. until we read 64kB.  This stops us from zeroing the entire vector when we double it, some of which may be wasted work.  Reallocation still follows the doubling strategy, but the responsibility has been moved to vec.extend(), which calls reserve() and push_back().
2015-04-02 00:40:38 +05:30
..
buffered.rs Test fixes and rebase conflicts, round 3 2015-03-31 17:39:24 -07:00
cursor.rs Test fixes and rebase conflicts, round 3 2015-03-31 17:39:24 -07:00
error.rs std: Stabilize last bits of io::Error 2015-03-31 16:12:48 -07:00
impls.rs std: Stabilize last bits of io::Error 2015-03-31 16:12:48 -07:00
lazy.rs std: Tweak rt::at_exit behavior 2015-03-21 11:14:58 -07:00
mod.rs Rollup merge of #23847 - bcoopers:read_clarification, r=sfackler 2015-04-02 00:40:38 +05:30
prelude.rs std: Update docs for removal of ReadExt, WriteExt 2015-03-24 22:20:35 +01:00
stdio.rs std: Don't deadlock/panic on recursive prints 2015-03-27 19:03:18 -07:00
util.rs Test fixes and rebase conflicts, round 3 2015-03-31 17:39:24 -07:00