aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrobot-contrib <robot-contrib@yandex-team.com>2025-04-10 08:09:38 +0300
committerrobot-contrib <robot-contrib@yandex-team.com>2025-04-10 08:21:25 +0300
commit8dfa76f60591ad4e87b77d2c0e055db2765fc059 (patch)
tree9097638c611353c2d031442759b628d591d794eb
parent9e68a769e8491bbaccd9f6bbf05a34788ca8477a (diff)
downloadydb-8dfa76f60591ad4e87b77d2c0e055db2765fc059.tar.gz
Update contrib/libs/snappy to 1.2.2
commit_hash:e5bd04977b473b07bf571aa7c6affab86ff562e1
-rw-r--r--contrib/libs/snappy/.yandex_meta/override.nix4
-rw-r--r--contrib/libs/snappy/NEWS15
-rw-r--r--contrib/libs/snappy/README.md8
-rw-r--r--contrib/libs/snappy/snappy-stubs-public.h2
-rw-r--r--contrib/libs/snappy/snappy.cc11
-rw-r--r--contrib/libs/snappy/ya.make4
6 files changed, 31 insertions, 13 deletions
diff --git a/contrib/libs/snappy/.yandex_meta/override.nix b/contrib/libs/snappy/.yandex_meta/override.nix
index 4ec7e2a3fce..45b24b0a1a6 100644
--- a/contrib/libs/snappy/.yandex_meta/override.nix
+++ b/contrib/libs/snappy/.yandex_meta/override.nix
@@ -1,11 +1,11 @@
pkgs: attrs: with pkgs; with attrs; rec {
- version = "1.2.1";
+ version = "1.2.2";
src = fetchFromGitHub {
owner = "google";
repo = "snappy";
rev = version;
- hash = "sha256-IzKzrMDjh+Weor+OrKdX62cAKYTdDXgldxCgNE2/8vk=";
+ hash = "sha256-bMZD8EI9dvDGupfos4hi/0ShBkrJlI5Np9FxE6FfrNE=";
};
patches = [];
diff --git a/contrib/libs/snappy/NEWS b/contrib/libs/snappy/NEWS
index 792a578001d..ef935ba52fa 100644
--- a/contrib/libs/snappy/NEWS
+++ b/contrib/libs/snappy/NEWS
@@ -1,3 +1,18 @@
+Snappy v1.2.2, Mar 26th 2025:
+
+ * We added a new compression level in v1.2.1 which compresses a bit
+ denser but slower. Decompression speed should be even faster with it.
+
+ * We fixed a very old issue of data corruption when compressed size
+ exceeds 4GB. This can happen when you compress data close to 4GB
+ and it's incompressible, for example, random data.
+
+ * Started to use minimum CMake 3.10 because older ones are not
+ planned to be supported.
+
+ * Various other small fixes and performance improvements (especially
+ for clang).
+
Snappy v1.1.10, Mar 8th 2023:
* Performance improvements
diff --git a/contrib/libs/snappy/README.md b/contrib/libs/snappy/README.md
index 398be7d58a6..9b4a49405c5 100644
--- a/contrib/libs/snappy/README.md
+++ b/contrib/libs/snappy/README.md
@@ -140,10 +140,10 @@ explicitly supports the following:
1. C++11
2. Clang (gcc and MSVC are best-effort).
3. Low level optimizations (e.g. assembly or equivalent intrinsics) for:
- 1. [x86](https://en.wikipedia.org/wiki/X86)
- 2. [x86-64](https://en.wikipedia.org/wiki/X86-64)
- 3. ARMv7 (32-bit)
- 4. ARMv8 (AArch64)
+ - [x86](https://en.wikipedia.org/wiki/X86)
+ - [x86-64](https://en.wikipedia.org/wiki/X86-64)
+ - ARMv7 (32-bit)
+ - ARMv8 (AArch64)
4. Supports only the Snappy compression scheme as described in
[format_description.txt](format_description.txt).
5. CMake for building
diff --git a/contrib/libs/snappy/snappy-stubs-public.h b/contrib/libs/snappy/snappy-stubs-public.h
index bc2a26a56c4..a2dec74dcc2 100644
--- a/contrib/libs/snappy/snappy-stubs-public.h
+++ b/contrib/libs/snappy/snappy-stubs-public.h
@@ -44,7 +44,7 @@
#define SNAPPY_MAJOR 1
#define SNAPPY_MINOR 2
-#define SNAPPY_PATCHLEVEL 1
+#define SNAPPY_PATCHLEVEL 2
#define SNAPPY_VERSION \
((SNAPPY_MAJOR << 16) | (SNAPPY_MINOR << 8) | SNAPPY_PATCHLEVEL)
diff --git a/contrib/libs/snappy/snappy.cc b/contrib/libs/snappy/snappy.cc
index a7b93f0f78e..5a326eb4085 100644
--- a/contrib/libs/snappy/snappy.cc
+++ b/contrib/libs/snappy/snappy.cc
@@ -74,6 +74,7 @@
#include <cstdint>
#include <cstdio>
#include <cstring>
+#include <functional>
#include <memory>
#include <string>
#include <utility>
@@ -1499,7 +1500,7 @@ class SnappyDecompressor {
// If ip < ip_limit_min_maxtaglen_ it's safe to read kMaxTagLength from
// buffer.
const char* ip_limit_min_maxtaglen_;
- uint32_t peeked_; // Bytes peeked from reader (need to skip)
+ uint64_t peeked_; // Bytes peeked from reader (need to skip)
bool eof_; // Hit end of input without an error?
char scratch_[kMaximumTagLength]; // See RefillTag().
@@ -1690,7 +1691,8 @@ constexpr uint32_t CalculateNeeded(uint8_t tag) {
#if __cplusplus >= 201402L
constexpr bool VerifyCalculateNeeded() {
for (int i = 0; i < 1; i++) {
- if (CalculateNeeded(i) != (char_table[i] >> 11) + 1) return false;
+ if (CalculateNeeded(i) != static_cast<uint32_t>((char_table[i] >> 11)) + 1)
+ return false;
}
return true;
}
@@ -1726,7 +1728,7 @@ bool SnappyDecompressor::RefillTag() {
assert(needed <= sizeof(scratch_));
// Read more bytes from reader if needed
- uint32_t nbuf = ip_limit_ - ip;
+ uint64_t nbuf = ip_limit_ - ip;
if (nbuf < needed) {
// Stitch together bytes from ip and reader to form the word
// contents. We store the needed bytes in "scratch_". They
@@ -1739,7 +1741,7 @@ bool SnappyDecompressor::RefillTag() {
size_t length;
const char* src = reader_->Peek(&length);
if (length == 0) return false;
- uint32_t to_add = std::min<uint32_t>(needed - nbuf, length);
+ uint64_t to_add = std::min<uint64_t>(needed - nbuf, length);
std::memcpy(scratch_ + nbuf, src, to_add);
nbuf += to_add;
reader_->Skip(to_add);
@@ -1802,6 +1804,7 @@ size_t Compress(Source* reader, Sink* writer, CompressionOptions options) {
int token = 0;
size_t written = 0;
size_t N = reader->Available();
+ assert(N <= 0xFFFFFFFFu);
const size_t uncompressed_size = N;
char ulength[Varint::kMax32];
char* p = Varint::Encode32(ulength, N);
diff --git a/contrib/libs/snappy/ya.make b/contrib/libs/snappy/ya.make
index f2bc4c7f1ab..ff6546925f4 100644
--- a/contrib/libs/snappy/ya.make
+++ b/contrib/libs/snappy/ya.make
@@ -6,9 +6,9 @@ LICENSE(BSD-3-Clause)
LICENSE_TEXTS(.yandex_meta/licenses.list.txt)
-VERSION(1.2.1)
+VERSION(1.2.2)
-ORIGINAL_SOURCE(https://github.com/google/snappy/archive/1.2.1.tar.gz)
+ORIGINAL_SOURCE(https://github.com/google/snappy/archive/1.2.2.tar.gz)
PEERDIR(
library/cpp/sanitizer/include