Skip to content

Commit 1b2e25f

Browse files
committed
update comments
1 parent 1bcd920 commit 1b2e25f

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

zstd_stream.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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.
408407
func 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

Comments
 (0)