From 2fa4c8c4054b1d38c67c22124f1f09a0dce04f6c Mon Sep 17 00:00:00 2001 From: Yann Collet Date: Wed, 3 Mar 2021 22:54:04 -0800 Subject: [PATCH] added code comments for new API ZSTD_seekTable --- contrib/seekable_format/zstd_seekable.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/contrib/seekable_format/zstd_seekable.h b/contrib/seekable_format/zstd_seekable.h index b7e2d82d..d2807cfb 100644 --- a/contrib/seekable_format/zstd_seekable.h +++ b/contrib/seekable_format/zstd_seekable.h @@ -172,6 +172,21 @@ ZSTDLIB_API size_t ZSTD_seekable_getFrameDecompressedSize(const ZSTD_seekable* z ZSTDLIB_API unsigned ZSTD_seekable_offsetToFrameIndex(const ZSTD_seekable* zs, unsigned long long offset); +/*-**************************************************************************** +* Direct exploitation of the seekTable +* +* Memory constrained use cases that manage multiple archives +* benefit from retaining multiple archive seek tables +* without retaining a ZSTD_seekable instance for each. +* +* Below API allow the above-mentioned use cases +* to initialize a ZSTD_seekable, extract its (smaller) ZSTD_seekTable, +* then throw the ZSTD_seekable away to save memory. +* +* Standard ZSTD operations can then be used +* to decompress frames based on seek table offsets. +******************************************************************************/ + /*===== Independent seek table management =====*/ ZSTDLIB_API ZSTD_seekTable* ZSTD_seekTable_create_fromSeekable(const ZSTD_seekable* zs); ZSTDLIB_API size_t ZSTD_seekTable_free(ZSTD_seekTable* st);