From 561e65969f89c6f60193cf1755752b571a1149f5 Mon Sep 17 00:00:00 2001 From: baude Date: Thu, 3 Jan 2019 08:55:35 -0600 Subject: vendor in new containers/storage vendor in latest containers/storage which contains a fix for when a filesystem that overlayfs is on is ENOSPC. adding pgzip/compress as a new dep for c/s Signed-off-by: baude --- .../github.com/klauspost/compress/flate/token.go | 115 +++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 vendor/github.com/klauspost/compress/flate/token.go (limited to 'vendor/github.com/klauspost/compress/flate/token.go') diff --git a/vendor/github.com/klauspost/compress/flate/token.go b/vendor/github.com/klauspost/compress/flate/token.go new file mode 100644 index 000000000..4f275ea61 --- /dev/null +++ b/vendor/github.com/klauspost/compress/flate/token.go @@ -0,0 +1,115 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package flate + +import "fmt" + +const ( + // 2 bits: type 0 = literal 1=EOF 2=Match 3=Unused + // 8 bits: xlength = length - MIN_MATCH_LENGTH + // 22 bits xoffset = offset - MIN_OFFSET_SIZE, or literal + lengthShift = 22 + offsetMask = 1< pair into a match token. +func matchToken(xlength uint32, xoffset uint32) token { + return token(matchType + xlength< maxMatchLength || xoffset > maxMatchOffset { + panic(fmt.Sprintf("Invalid match: len: %d, offset: %d\n", xlength, xoffset)) + return token(matchType) + } + return token(matchType + xlength<> lengthShift) } + +func lengthCode(len uint32) uint32 { return lengthCodes[len] } + +// Returns the offset code corresponding to a specific offset +func offsetCode(off uint32) uint32 { + if off < uint32(len(offsetCodes)) { + return offsetCodes[off] + } else if off>>7 < uint32(len(offsetCodes)) { + return offsetCodes[off>>7] + 14 + } else { + return offsetCodes[off>>14] + 28 + } +} -- cgit v1.2.3-54-g00ecf