Skip to content

Commit

Permalink
Remove #[inline(always)] from CompressorOxide::default() (#125)
Browse files Browse the repository at this point in the history
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:
rust-lang/rust#101814
  • Loading branch information
jrmuizel authored Sep 15, 2022
1 parent 1dce973 commit c7643aa
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion miniz_oxide/src/deflate/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit c7643aa

Please sign in to comment.