about summary refs log tree commit diff
path: root/library/std/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-04-08 10:41:10 +0000
committerbors <bors@rust-lang.org>2022-04-08 10:41:10 +0000
commite4f5b15b8832334eca2c0bd3929eb3969f1d166d (patch)
tree9b5684d1a1da8238910873984b75fa03e1bf0c4a /library/std/src
parent1a4b9a85634c17a60e8802307510c300a35a4b9b (diff)
parent7b285d09e9e4ccf8273cc03dba28e8a428e6084e (diff)
downloadrust-e4f5b15b8832334eca2c0bd3929eb3969f1d166d.tar.gz
rust-e4f5b15b8832334eca2c0bd3929eb3969f1d166d.zip
Auto merge of #95798 - Dylan-DPC:rollup-51hx1wl, r=Dylan-DPC
Rollup of 7 pull requests

Successful merges:

 - #95102 (Add known-bug for #95034)
 - #95579 (Add `<[[T; N]]>::flatten{_mut}`)
 - #95634 (Mailmap update)
 - #95705 (Promote x86_64-unknown-none target to Tier 2 and distribute build artifacts)
 - #95761 (Kickstart the inner usage of `macro_metavar_expr`)
 - #95782 (Windows: Increase a pipe's buffer capacity to 64kb)
 - #95791 (hide an #[allow] directive from the Arc::new_cyclic doc example)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'library/std/src')
-rw-r--r--library/std/src/sys/windows/pipe.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/library/std/src/sys/windows/pipe.rs b/library/std/src/sys/windows/pipe.rs
index df4f1b24eec..09d1dd55989 100644
--- a/library/std/src/sys/windows/pipe.rs
+++ b/library/std/src/sys/windows/pipe.rs
@@ -53,6 +53,9 @@ pub struct Pipes {
 /// with `OVERLAPPED` instances, but also works out ok if it's only ever used
 /// once at a time (which we do indeed guarantee).
 pub fn anon_pipe(ours_readable: bool, their_handle_inheritable: bool) -> io::Result<Pipes> {
+    // A 64kb pipe capacity is the same as a typical Linux default.
+    const PIPE_BUFFER_CAPACITY: u32 = 64 * 1024;
+
     // Note that we specifically do *not* use `CreatePipe` here because
     // unfortunately the anonymous pipes returned do not support overlapped
     // operations. Instead, we create a "hopefully unique" name and create a
@@ -91,8 +94,8 @@ pub fn anon_pipe(ours_readable: bool, their_handle_inheritable: bool) -> io::Res
                     | c::PIPE_WAIT
                     | reject_remote_clients_flag,
                 1,
-                4096,
-                4096,
+                PIPE_BUFFER_CAPACITY,
+                PIPE_BUFFER_CAPACITY,
                 0,
                 ptr::null_mut(),
             );