-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
ZSTD_CCtx_setCParams #3403
ZSTD_CCtx_setCParams #3403
Conversation
Inspired by #3395, offer a new capability to set all parameters defined in a ZSTD_compressionParameters structure with a single symbol invocation to improve user code brevity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just one small nit and one potential issue that might require changes (hence, I am requesting changes). Feel free to land if changes aren't required.
Hm... I just thought of a possible issue. You are assuming all the parameters in |
That's a very good point @embg . That's indeed the case : That being said, I agree this situation is not clear for users, so adding a code comment to specify this behavior would be helpful. |
Thanks for the pointer. Another question for my own understanding: how does this work for single-threaded compression? E.g. if ZSTD_CCtx_setCParams() is called in the middle of a frame, during streaming compression? |
If (allowed) parameters are changed during single-threaded streaming compression, actually nothing changes for the current compression session. Changes are merely registered into |
Inspired by @terrelln in #3395,
offer a new capability to set all parameters defined in a
ZSTD_compressionParameters
structure with a single symbol invocation to improve user code brevity.