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
API: add LZ4_decompress_safe_partial_usingDict
to support partial decompression with dict
#1093
Conversation
Signed-off-by: Qi Wang <wangqi@linux.alibaba.com>
dacd14c
to
8540b21
Compare
lib/lz4.h
Outdated
@@ -777,6 +778,8 @@ LZ4LIB_API int LZ4_decompress_fast_usingDict (const char* src, char* dst, int or | |||
LZ4LIB_API void LZ4_resetStream (LZ4_stream_t* streamPtr); | |||
|
|||
|
|||
/*! Obsolete partial decompress with dict functions */ | |||
LZ4_DEPRECATED("use LZ4_decompress_safe_partial_usingDict() instead") LZ4LIB_API int LZ4_decompress_safe_partial_withPrefix64k(const char* source, char* dest, int compressedSize, int targetOutputSize, int dstCapacity); |
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.
It's unusual for a newly introduced function to be immediately classified "deprecated".
Is this entry added for the sake of consistency with LZ4_decompress_safe_withPrefix64k()
?
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.
Thanks for your review! Yes, should I remove it?
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.
Yes please
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.
Thanks! Done.
@@ -47,7 +52,61 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) | |||
FUZZ_ASSERT_MSG(!memcmp(data, partial, partialSize), "Corruption!"); | |||
free(partial); | |||
} | |||
|
|||
/* Partial decompression using dict with no dict. */ |
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.
That's pretty nice,
good testing is a must for a new feature.
The implementation looks fine to me. Moreover, it comes with a great battery of tests, which is a welcome relief for reliability concerns. I'm a little concerned by the length of the selected name |
OK, I'll go ahead and say that it's almost completely fine, on first attempt. So that's great job. Even the name is green-lighted, because it's a direct reference to existing My only comment is about |
Thanks for your review! I will remove the |
feature request: lz4#1051 Signed-off-by: Qi Wang <wangqi@linux.alibaba.com>
Signed-off-by: Qi Wang <wangqi@linux.alibaba.com>
Signed-off-by: Qi Wang <wangqi@linux.alibaba.com>
LZ4_decompress_safe_partial_usingDict
to support partial decompression with dictLZ4_decompress_safe_partial_usingDict
to support partial decompression with dict
Hi Cyan, could we merge it so I can develop more based on this? Many thanks! |
Thanks! |
Add
LZ4_decompress_safe_partial_usingDict
API to support partial decompression with dictionary.This patch is still working in progress, I will appreciate it if you guys could give me some suggestions. Thanks for your review!
Feature request #1051.