Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate skippable frame API #2439

Merged
merged 3 commits into from
Dec 28, 2020
Merged

Conversation

senhuang42
Copy link
Contributor

ZSTD_writeSkippableFrame(void* dst, size_t dstCapacity, const void* src, size_t srcSize, U32 magicVariant)

Writes a skippable frame into dst buffer, using src content, and using one of the 16 available skippable frame magic numbers, controllable with magicVariant. More detailed documentation in zstd.h.

Test Plan:

  • Modify existing unit test to ensure roundtrip-ability

@terrelln
Copy link
Contributor

This looks good to me. Is there a particular use case that motivates adding this to the API?

@senhuang42
Copy link
Contributor Author

Was mentioned in #2275 that this might be a nice thing to have.

@Cyan4973
Copy link
Contributor

U32 magicVariant

In the future, if we ever come to settle on a few skippable frame IDs implying something meaningful, we could use an enum instead. Or in complementarity, as I think this is compatible with U32, so it should be fine.

Speaking of "meaningful" skippable frame IDs, maybe we could consider those from pzstd, and maybe the seekable format.

@Cyan4973 Cyan4973 merged commit cfff4c1 into facebook:dev Dec 28, 2020
Cyan4973 added a commit that referenced this pull request Dec 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants