Support the new long-distance matcher (#117)

zstd 1.3.2 added a long-distance matcher
(https://github.com/facebook/zstd/releases/tag/v1.3.2); add a function
to set that parameter.
This commit is contained in:
Josh Triplett 2021-05-03 08:47:18 -07:00 committed by GitHub
parent 4ecd2b6ab7
commit 17b984195e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -74,6 +74,18 @@ macro_rules! readwritecommon {
)
}
/// Enables or disables long-distance matching
pub fn long_distance_matching(
&mut self,
long_distance_matching: bool,
) -> io::Result<()> {
self.$readwrite.operation_mut().set_parameter(
zstd_safe::CParameter::EnableLongDistanceMatching(
long_distance_matching,
),
)
}
#[cfg(feature = "experimental")]
/// Enables or disable the magic bytes at the beginning of each frame.
///