| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 0101855 commit 3032a7e
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -298,7 +298,6 @@ class ZstdContext : public MemoryRetainer { | |||
| 298 | 298 | ZstdContext() = default; | |
| 299 | 299 | ||
| 300 | 300 | // Streaming-related, should be available for all compression libraries: | |
| 301 | - void Close(); | ||
| 302 | 301 | void SetBuffers(const char* in, uint32_t in_len, char* out, uint32_t out_len); | |
| 303 | 302 | void SetFlush(int flush); | |
| 304 | 303 | void GetAfterWriteOffsets(uint32_t* avail_in, uint32_t* avail_out) const; | |
@@ -323,6 +322,7 @@ class ZstdCompressContext final : public ZstdContext { | |||
| 323 | 322 | ZstdCompressContext() = default; | |
| 324 | 323 | ||
| 325 | 324 | // Streaming-related, should be available for all compression libraries: | |
| 325 | + void Close(); | ||
| 326 | 326 | void DoThreadPoolWork(); | |
| 327 | 327 | CompressionError ResetStream(); | |
| 328 | 328 | ||
@@ -349,6 +349,7 @@ class ZstdDecompressContext final : public ZstdContext { | |||
| 349 | 349 | ZstdDecompressContext() = default; | |
| 350 | 350 | ||
| 351 | 351 | // Streaming-related, should be available for all compression libraries: | |
| 352 | + void Close(); | ||
| 352 | 353 | void DoThreadPoolWork(); | |
| 353 | 354 | CompressionError ResetStream(); | |
| 354 | 355 | ||
@@ -1488,8 +1489,6 @@ CompressionError BrotliDecoderContext::GetErrorInfo() const { | |||
| 1488 | 1489 | } | |
| 1489 | 1490 | } | |
| 1490 | 1491 | ||
| 1491 | - void ZstdContext::Close() {} | ||
| 1492 | - | ||
| 1493 | 1492 | void ZstdContext::SetBuffers(const char* in, | |
| 1494 | 1493 | uint32_t in_len, | |
| 1495 | 1494 | char* out, | |
@@ -1533,6 +1532,10 @@ CompressionError ZstdCompressContext::SetParameter(int key, int value) { | |||
| 1533 | 1532 | return {}; | |
| 1534 | 1533 | } | |
| 1535 | 1534 | ||
| 1535 | + void ZstdCompressContext::Close() { | ||
| 1536 | + cctx_.reset(); | ||
| 1537 | + } | ||
| 1538 | + | ||
| 1536 | 1539 | CompressionError ZstdCompressContext::Init(uint64_t pledged_src_size, | |
| 1537 | 1540 | std::string_view dictionary) { | |
| 1538 | 1541 | pledged_src_size_ = pledged_src_size; | |
@@ -1585,6 +1588,10 @@ CompressionError ZstdDecompressContext::SetParameter(int key, int value) { | |||
| 1585 | 1588 | return {}; | |
| 1586 | 1589 | } | |
| 1587 | 1590 | ||
| 1591 | + void ZstdDecompressContext::Close() { | ||
| 1592 | + dctx_.reset(); | ||
| 1593 | + } | ||
| 1594 | + | ||
| 1588 | 1595 | CompressionError ZstdDecompressContext::Init(uint64_t pledged_src_size, | |
| 1589 | 1596 | std::string_view dictionary) { | |
| 1590 | 1597 | dctx_.reset(ZSTD_createDCtx()); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments