File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -52,11 +52,13 @@ const MAGIC_NO_OUTSTANDING_DATA_CODE: u32 = MAGIC_CODE_BASE + 0;
5252const MAGIC_CHANNEL_CLOSED_CODE : u32 = MAGIC_CODE_BASE + 1 ;
5353
5454// When we create the pipe, how big of a write buffer do we specify?
55- // This is reserved in the nonpaged pool.
56- //
57- // This is 80k because a lot of the test assume that we can write a
58- // 64k buffer without fragmentation. This is unfortunate.
59- const WRITE_BUFFER_SIZE : usize = 80 * 1024 ; // 64k+16k
55+ // This is reserved in the nonpaged pool. The fragment size is the
56+ // max we can write to the pipe without fragmentation, and the
57+ // buffer size is what we tell the pipe it is, so we have room
58+ // for out of band data etc. We can probably do way less than
59+ // 16k extra.
60+ const MAX_FRAGMENT_SIZE : usize = 64 * 1024 ;
61+ const WRITE_BUFFER_SIZE : usize = MAX_FRAGMENT_SIZE + 16 * 1024 ;
6062
6163// When we read, how big of a heap buffer do we allocate?
6264const READ_BUFFER_SIZE : usize = 128 * 1024 ; //128k;
@@ -834,6 +836,10 @@ impl OsIpcSender {
834836 OsIpcSender :: connect_pipe_id ( Uuid :: parse_str ( & name) . unwrap ( ) )
835837 }
836838
839+ pub fn get_max_fragment_size ( ) -> usize {
840+ MAX_FRAGMENT_SIZE
841+ }
842+
837843 fn from_handle ( handle : HANDLE ) -> OsIpcSender {
838844 OsIpcSender {
839845 handle : WinHandle :: new ( handle) ,
You can’t perform that action at this time.
0 commit comments