Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/uu/cat/src/cat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,10 @@ fn write_fast<R: FdReadable>(handle: &mut InputHandle<R>) -> CatResult<()> {
// If we're not on Linux or Android, or the splice() call failed,
// fall back on slower writing.
let mut stdout_lock = stdout.lock();
// stack allocation is overhead when splice succeed
#[cfg(any(target_os = "linux", target_os = "android"))]
let mut buf = vec![0; 1024 * 64];
#[cfg(not(any(target_os = "linux", target_os = "android")))]
let mut buf = [0; 1024 * 64];
loop {
match handle.reader.read(&mut buf) {
Expand Down
Loading