summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2016-11-30Move small-copy optimization into <&[u8] as Read>Ruud van Asseldonk-2/+20
Based on the discussion in https://github.com/rust-lang/rust/pull/37573, it is likely better to keep this limited to std::io, instead of modifying a function which users expect to be a memcpy.
2016-11-30Move small-copy optimization into copy_from_sliceRuud van Asseldonk-15/+3
Ultimately copy_from_slice is being a bottleneck, not io::Cursor::read. It might be worthwhile to move the check here, so more places can benefit from it.
2016-11-30Add small-copy optimization for io::CursorRuud van Asseldonk-3/+15
During benchmarking, I found that one of my programs spent between 5 and 10 percent of the time doing memmoves. Ultimately I tracked these down to single-byte slices being copied with a memcopy in io::Cursor::read(). Doing a manual copy if only one byte is requested can speed things up significantly. For my program, this reduced the running time by 20%. Why special-case only a single byte, and not a "small" slice in general? I tried doing this for slices of at most 64 bytes and of at most 8 bytes. In both cases my test program was significantly slower.
2016-11-30Rename 'librustc_unicode' crate to 'libstd_unicode'.Corey Farwell-4/+4
Fixes #26554.
2016-11-29Add missing examples for IpAddr enumGuillaume Gomez-0/+88
2016-11-28Commit to fix make tidyJeremy Soller-44/+157
2016-11-28Remove file path from std::fs::FileJeremy Soller-14/+2
2016-11-28Move stdout/err flush into sysJeremy Soller-9/+25
2016-11-28Switch to using Prefix::VerbatimJeremy Soller-6/+4
2016-11-28Switch to using syscall crate directly - without importJeremy Soller-188/+171
2016-11-28std: Fix partial writes in LineWriterAlex Crichton-13/+86
Previously the `LineWriter` could successfully write some bytes but then fail to report that it has done so. Additionally, an erroneous flush after a successful write was permanently ignored. This commit fixes these two issues by (a) maintaining a `need_flush` flag to indicate whether a flush should be the first operation in `LineWriter::write` and (b) avoiding returning an error once some bytes have been successfully written. Closes #37807
2016-11-27Auto merge of #38019 - sourcefrog:doc-separator, r=frewsxcvbors-1/+3
Clearer description of std::path::MAIN_SEPARATOR.
2016-11-27Auto merge of #38022 - arthurprs:micro-opt-hm, r=blussbors-18/+21
Use displacement instead of initial bucket in HashMap code Use displacement instead of initial bucket in HashMap code. It makes the code a bit cleaner and also saves a few instructions (handy since it'll be using some to do some sort of adaptive behavior soon).
2016-11-27Use displacement instead of initial bucket in HashMap codearthurprs-18/+21
2016-11-27Auto merge of #37983 - GuillaumeGomez:tcp_listener_doc, r=frewsxcvbors-3/+118
Add examples for TcpListener struct r? @frewsxcv
2016-11-27Add examples for TcpListener structGuillaume Gomez-3/+118
2016-11-26Auto merge of #38004 - GuillaumeGomez:tcp_stream_doc, r=frewsxcvbors-8/+185
Add missing urls and examples to TcpStream r? @frewsxcv
2016-11-26Add part of missing UdpSocket's urls and examplesGuillaume Gomez-11/+215
2016-11-26Clearer description of std::path::MAIN_SEPARATOR.Martin Pool-1/+3
2016-11-26Rollup merge of #38010 - frewsxcv:lock-creations, r=GuillaumeGomezSeo Sanghyeon-1/+22
Document how lock 'guard' structures are created.
2016-11-26Rollup merge of #38001 - vickenty:patch-1, r=steveklabnikSeo Sanghyeon-2/+2
Follow our own recommendations in the examples Remove exclamation marks from the the example error descriptions: > The description [...] should not contain newlines or sentence-ending punctuation
2016-11-26Rollup merge of #37985 - frewsxcv:completed-fixme, r=petrochenkovSeo Sanghyeon-1/+1
Remove completed FIXME. https://github.com/rust-lang/rust/issues/30530
2016-11-26Rollup merge of #37978 - fkjogu:master, r=sfacklerSeo Sanghyeon-5/+5
Define `bound` argument in std::sync::mpsc::sync_channel in the documentation The `bound` argument in `std::sync::mpsc::sync:channel(bound: usize)` was not defined in the documentation.
2016-11-26Rollup merge of #37962 - GuillaumeGomez:socket-v6, r=frewsxcvSeo Sanghyeon-0/+84
Add missing examples to SocketAddrV6 r? @steveklabnik cc @frewsxcv
2016-11-25Fix canonicalizeJeremy Soller-3/+2
2016-11-25Use O_DIRECTORYJeremy Soller-9/+12
2016-11-25Document how the `MutexGuard` structure is created.Corey Farwell-1/+8
Also, end sentence with a period.
2016-11-25Document how the `RwLockWriteGuard` structure is created.Corey Farwell-0/+7
2016-11-25Document how the `RwLockReadGuard` structure is created.Corey Farwell-0/+7
2016-11-25Add missing urls and examples to TcpStreamGuillaume Gomez-8/+185
2016-11-25Follow our own recommendations in the examplesVickenty Fesunov-2/+2
Remove exclamation marks from the the example error descriptions: > The description [...] should not contain newlines or sentence-ending punctuation
2016-11-24Remove completed FIXME.Corey Farwell-1/+1
https://github.com/rust-lang/rust/issues/30530
2016-11-24Define `bound` argument in std::sync::mpsc::sync_channelfkjogu-5/+5
The `bound` argument in `std::sync::mpsc::sync:channel(bound: usize)` was not defined in the documentation.
2016-11-23std: make compilation of libpanic_unwind optional via a Cargo featureJorge Aparicio-2/+3
with this feature disabled, you can (Cargo) compile std with "panic=abort" rustbuild will build std with this feature enabled, to maintain the status quo fixes #37252
2016-11-23Separated fuchsia-specific process stuff into 'process_fuchsia.rs' and ↵Theodore DeRego-868/+940
refactored out some now-duplicated code into a 'process_common.rs'
2016-11-23Allow setting nonblock on socketsJeremy Soller-11/+16
2016-11-23Add missing examples to SocketAddrV6Guillaume Gomez-0/+84
2016-11-23Add File set_permissionsJeremy Soller-0/+4
2016-11-23Merge branch 'master' into redoxJeremy Soller-10/+205
2016-11-23Add ::1 example in IPv6 to IPv4 conversionGuillaume Gomez-15/+44
2016-11-23Rollup merge of #37925 - jtdowney:env-args-doc-links, r=steveklabnikGuillaume Gomez-5/+13
Add some internal docs links for Args/ArgsOs In many places the docs link to other sections and I noticed it was lacking here. Not sure if there is a standard for if inter-linking is appropriate.
2016-11-23Rollup merge of #37913 - GuillaumeGomez:socket-v4, r=frewsxcvGuillaume Gomez-0/+46
Add missing examples for SocketAddrV4 r? @steveklabnik cc @frewsxcv
2016-11-22Whoops :| s/update/unwrap/Theodore DeRego-1/+1
2016-11-22Cleaned up and appeased the linterTheodore DeRego-77/+30
2016-11-22Fuchsia support for std::process via liblaunchpad.Theodore DeRego-5/+426
2016-11-22Add a method for setting permissions directly on an open file.Steven Allen-0/+85
On unix like systems, the underlying file corresponding to any given path may change at any time. This function makes it possible to set the permissions of the a file corresponding to a `File` object even if its path changes.
2016-11-22Add missing examples for Ipv6AddrGuillaume Gomez-0/+129
2016-11-21Add some internal docs links for Args/ArgsOsJohn Downey-5/+13
2016-11-21Auto merge of #37677 - jsen-:master, r=alexcrichtonbors-8/+26
libstd: support creation of anonymous pipe on WinXP/2K3 `PIPE_REJECT_REMOTE_CLIENTS` flag is not supported on Windows < VISTA, and every invocation of `anon_pipe` including attempts to pipe `std::process::Child`'s stdio fails. This PR should work around this issue by performing a runtime check of windows version and conditionally omitting this flag on "XP and friends". Getting the version should be probably moved out of the function `anon_pipe` itself (the OS version does not often change during runtime :) ), but: - I didn't find any precedent for this and assuming there's not much overhead (I hope windows does not perform any heuristics to find out it's own version, just fills couple of fields in the struct). - the code path is not especially performance sensitive anyway.
2016-11-21Add missing examples for SocketAddrV4Guillaume Gomez-0/+46