about summary refs log tree commit diff
path: root/library/std/src/io/copy.rs
AgeCommit message (Collapse)AuthorLines
2021-02-24library: Normalize safety-for-unsafe-block commentsMiguel Ojeda-1/+1
Almost all safety comments are of the form `// SAFETY:`, so normalize the rest and fix a few of them that should have been a `/// # Safety` section instead. Furthermore, make `tidy` only allow the uppercase form. While currently `tidy` only checks `core`, it is a good idea to prevent `core` from drifting to non-uppercase comments, so that later we can start checking `alloc` etc. too. Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2021-01-31specialize io::copy to use the memory of the writer if it is a BufWriterThe8472-6/+74
2020-11-13limit visibility of copy offload helpers to sys::unix moduleThe8472-3/+0
2020-11-13move copy specialization tests to their own moduleThe8472-0/+3
2020-11-13move copy specialization into sys::unix moduleThe8472-377/+8
2020-11-13reduce syscalls by inferring FD types based on source struct instead of ↵The8472-66/+102
calling stat() also adds handling for edge-cases involving large sparse files where sendfile could fail with EOVERFLOW
2020-11-13add forwarding specializations for &mut variantsThe8472-0/+21
`impl Write for &mut T where T: Write`, thus the same should apply to the specialization traits
2020-11-13prioritize sendfile over splice since it results in fewer context switches ↵The8472-16/+16
when sending to pipes splice returns to userspace when the pipe is full, sendfile just blocks until it's done, this can achieve much higher throughput
2020-11-13move tests module into separate fileThe8472-56/+0
2020-11-13specialize io::copy to use copy_file_range, splice or sendfileThe8472-0/+456
Currently it only applies to linux systems. It can be extended to make use of similar syscalls on other unix systems.