File tree Expand file tree Collapse file tree 3 files changed +6
-10
lines changed Expand file tree Collapse file tree 3 files changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,9 @@ pub struct DeflateStream<'a> {
5050 pub ( crate ) reserved : crate :: c_api:: uLong ,
5151}
5252
53+ unsafe impl Sync for DeflateStream < ' _ > { }
54+ unsafe impl Send for DeflateStream < ' _ > { }
55+
5356impl < ' a > DeflateStream < ' a > {
5457 // z_stream and DeflateStream must have the same layout. Do our best to check if this is true.
5558 // (imperfect check, but should catch most mistakes.)
Original file line number Diff line number Diff line change @@ -50,6 +50,9 @@ pub struct InflateStream<'a> {
5050 pub ( crate ) reserved : crate :: c_api:: uLong ,
5151}
5252
53+ unsafe impl Sync for InflateStream < ' _ > { }
54+ unsafe impl Send for InflateStream < ' _ > { }
55+
5356#[ cfg( feature = "__internal-test" ) ]
5457#[ doc( hidden) ]
5558pub const INFLATE_STATE_SIZE : usize = core:: mem:: size_of :: < crate :: inflate:: State > ( ) ;
Original file line number Diff line number Diff line change @@ -67,11 +67,6 @@ impl InflateError {
6767/// The state that is used to decompress an input.
6868pub struct Inflate ( crate :: inflate:: InflateStream < ' static > ) ;
6969
70- // SAFETY: the stream contains raw pointers, but the `Deflate` API enforces
71- // the correct aliasing and mutability constraints.
72- unsafe impl Sync for Inflate { }
73- unsafe impl Send for Inflate { }
74-
7570impl Inflate {
7671 /// The amount of bytes consumed from the input so far.
7772 pub fn total_in ( & self ) -> u64 {
@@ -195,11 +190,6 @@ impl From<ReturnCode> for Result<Status, DeflateError> {
195190/// The state that is used to compress an input.
196191pub struct Deflate ( crate :: deflate:: DeflateStream < ' static > ) ;
197192
198- // SAFETY: the stream contains raw pointers, but the `Deflate` API enforces
199- // the correct aliasing and mutability constraints.
200- unsafe impl Sync for Deflate { }
201- unsafe impl Send for Deflate { }
202-
203193impl Deflate {
204194 /// The number of bytes that were read from the input.
205195 pub fn total_in ( & self ) -> u64 {
You can’t perform that action at this time.
0 commit comments