Frommi / miniz_oxide

Rust replacement for miniz
MIT License
168 stars 48 forks source link

Remove #[inline(always)] from CompressorOxide::default() #125

Closed jrmuizel closed 1 year ago

jrmuizel commented 1 year ago

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