File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -45,8 +45,11 @@ impl FrameHeader {
4545 // `Window_Descriptor
4646 // TODO: https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#window_descriptor
4747 if !self . single_segment {
48- let exponent = 7 ;
49- output. push ( exponent << 3 ) ;
48+ if let Some ( window_size) = self . window_size {
49+ let log = window_size. next_power_of_two ( ) . ilog2 ( ) ;
50+ let exponent = if log > 10 { log - 10 } else { 1 } as u8 ;
51+ output. push ( exponent << 3 ) ;
52+ }
5053 }
5154
5255 if let Some ( id) = self . dictionary_id {
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ impl Matcher for MatchGeneratorDriver {
5050 }
5151
5252 fn window_size ( & self ) -> u64 {
53- 256 * 1024
53+ self . match_generator . max_window_size as u64
5454 }
5555
5656 fn get_next_space ( & mut self ) -> Vec < u8 > {
You can’t perform that action at this time.
0 commit comments