mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
vendor: update buildkit to 2f99651
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
10
vendor/github.com/klauspost/compress/zstd/encoder_options.go
generated
vendored
10
vendor/github.com/klauspost/compress/zstd/encoder_options.go
generated
vendored
@ -24,6 +24,7 @@ type encoderOptions struct {
|
||||
allLitEntropy bool
|
||||
customWindow bool
|
||||
customALEntropy bool
|
||||
customBlockSize bool
|
||||
lowMem bool
|
||||
dict *dict
|
||||
}
|
||||
@ -33,7 +34,7 @@ func (o *encoderOptions) setDefault() {
|
||||
concurrent: runtime.GOMAXPROCS(0),
|
||||
crc: true,
|
||||
single: nil,
|
||||
blockSize: 1 << 16,
|
||||
blockSize: maxCompressedBlockSize,
|
||||
windowSize: 8 << 20,
|
||||
level: SpeedDefault,
|
||||
allLitEntropy: true,
|
||||
@ -106,6 +107,7 @@ func WithWindowSize(n int) EOption {
|
||||
o.customWindow = true
|
||||
if o.blockSize > o.windowSize {
|
||||
o.blockSize = o.windowSize
|
||||
o.customBlockSize = true
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@ -188,10 +190,9 @@ func EncoderLevelFromZstd(level int) EncoderLevel {
|
||||
return SpeedDefault
|
||||
case level >= 6 && level < 10:
|
||||
return SpeedBetterCompression
|
||||
case level >= 10:
|
||||
default:
|
||||
return SpeedBestCompression
|
||||
}
|
||||
return SpeedDefault
|
||||
}
|
||||
|
||||
// String provides a string representation of the compression level.
|
||||
@ -222,6 +223,9 @@ func WithEncoderLevel(l EncoderLevel) EOption {
|
||||
switch o.level {
|
||||
case SpeedFastest:
|
||||
o.windowSize = 4 << 20
|
||||
if !o.customBlockSize {
|
||||
o.blockSize = 1 << 16
|
||||
}
|
||||
case SpeedDefault:
|
||||
o.windowSize = 8 << 20
|
||||
case SpeedBetterCompression:
|
||||
|
Reference in New Issue
Block a user