Add support for the seekable format #310
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds bindings for the seekable format to zstd-safe. Everything is behind the
seekable
feature flag, which disabled by default, and the basic functionality is covered by unit tests. In general, this is close to a 1-for-1 mapping to the seekable format C functions using rust types.However, everything around the seek table API is commented out for now. I noticed that the creation of a seek table in
ZSTD_seekTable_create_fromSeekable()
(which is the only way to create a seek table) can cause a segmentation fault, if called with an uninitialized seekable. There is already a PR open upstream to fix the issue (facebook/zstd#4201). The complete seekable format can be used without access to the seek table functions without limitations, afaict they only provide advantages when working with multiple seekable archives in memory constrained environments.This feature is also requested in #272