@@ -123,9 +123,8 @@ func NewWriterLevelDict(w io.Writer, level int, dict []byte) *Writer {
123123}
124124
125125// NewWriterLevelDictWindowSize is like NewWriterLevelDict but allows configuring
126- // the window size. windowSize is specified in bytes and will be converted to a windowLog
127- // parameter (log2 of the window size). If windowSize is 0, the default window size is used.
128- // The windowSize must be a power of 2 between 1KB and 8MB on 32-bit platforms
126+ // the window size, specificed in bytes. If windowSize is 0, the default window size is used.
127+ // The windowSize must be a power of 2 between 1KB and 1GB on 32-bit platforms,
129128// or 1KB and 2GB on 64-bit platforms.
130129// A larger window size allows for better compression ratios for repetitive data
131130// but requires more memory during compression and decompression.
@@ -401,14 +400,13 @@ func NewReaderDict(r io.Reader, dict []byte) io.ReadCloser {
401400}
402401
403402// NewReaderDictMaxWindowSize is like NewReaderDict but allows configuring the maximum
404- // window size for decompression. maxWindowSize is specified in bytes, not as a log value .
403+ // window size for decompression, specified in bytes.
405404// If maxWindowSize is 0, the default window size limit is used.
406405// Setting a maximum window size protects against allocating too much memory for
407406// decompression (potential attack scenario) when processing untrusted inputs.
408407func NewReaderDictMaxWindowSize (r io.Reader , dict []byte , maxWindowSize int ) io.ReadCloser {
409408 var err error
410409 ctx := C .ZSTD_createDStream ()
411-
412410 if len (dict ) == 0 {
413411 err = getError (int (C .ZSTD_initDStream (ctx )))
414412 } else {
0 commit comments