diff options
| author | Barosl Lee <vcs@barosl.com> | 2015-08-26 21:27:32 +0900 |
|---|---|---|
| committer | Barosl Lee <vcs@barosl.com> | 2015-08-28 04:48:03 +0900 |
| commit | 6065678e627643cc3275c677408d11f48802595e (patch) | |
| tree | b9fdd3cbaad37da03cdaa6b7730746239c0673e2 /src/libstd/sys/unix/stack_overflow.rs | |
| parent | 7723550fdd7fe29bee9dcbd45bdef4f209a7e1f1 (diff) | |
| download | rust-6065678e627643cc3275c677408d11f48802595e.tar.gz rust-6065678e627643cc3275c677408d11f48802595e.zip | |
Use a different buffer doubling logic for `std::sys::os::getcwd`
Make `std::sys::os::getcwd` call `Vec::reserve(1)` followed by `Vec::set_len` to double the buffer. This is to align with other similar functions, such as: - `std::sys_common::io::read_to_end_uninitialized` - `std::sys::fs::readlink` Also, reduce the initial buffer size from 2048 to 512. The previous size was introduced with 4bc26ce in 2013, but it seems a bit excessive. This is probably because buffer doubling was not implemented back then.
Diffstat (limited to 'src/libstd/sys/unix/stack_overflow.rs')
0 files changed, 0 insertions, 0 deletions
