From c7643aa2ddd5c2ca45f6f506b281ee988ea8a296 Mon Sep 17 00:00:00 2001 From: Jeff Muizelaar Date: Thu, 15 Sep 2022 02:19:04 -0400 Subject: [PATCH] Remove #[inline(always)] from CompressorOxide::default() (#125) With #[inline(always)] the body of default() will be inlined into external crates but the body will still contain calls to the LZOxide::new(), ParamsOxide::new(DEFAULT_FLAGS), Box::default() and DictOxide::new(DEFAULT_FLAGS). This ends up causing a copy of the large LZOxide to end up on the stack when used with Box::default as seen in: https://github.com/rust-lang/rust/issues/101814 --- miniz_oxide/src/deflate/core.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/miniz_oxide/src/deflate/core.rs b/miniz_oxide/src/deflate/core.rs index 91a9bf8b..d2db2600 100644 --- a/miniz_oxide/src/deflate/core.rs +++ b/miniz_oxide/src/deflate/core.rs @@ -517,7 +517,6 @@ impl CompressorOxide { impl Default for CompressorOxide { /// Initialize the compressor with a level of 4, zlib wrapper and /// the default strategy. - #[inline(always)] fn default() -> Self { CompressorOxide { lz: LZOxide::new(),