This repository has been archived by the owner on Mar 24, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lib: zstd: Remove large inline functions in zstd_lazy.c
Backport of upstream PR #2828 [0]. Large functions with excessive force inlining can cause trouble for compilers, and can sometimes take excess stack space because the compiler isn't able to fully analyze the function. This commit splits functions that have multiple copies of the same body into multiple smaller functions, which can help the compiler. This commit isn't strictly necessary, as the reported problems [1] are in zstd_fast.c and zstd_double_fast.c. But, these functions are using the same pattern, so they could also be problematic. And, we already had the fix sitting in our dev branch for our next release, so I figured I'd add it in for consistency. Bloat-o-meter output summary on x86-64 shows we also save 1.5 KB of code size: ``` > ../scripts/bloat-o-meter vmlinux.old vmlinux add/remove: 50/5 grow/shrink: 10/6 up/down: 28810/-30369 (-1559) Total: Before=6418562, After=6417003, chg -0.02% ``` [0] facebook/zstd#2828 [1] https://lkml.org/lkml/2021/11/15/710 Reported-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Nick Terrell <[email protected]>
- Loading branch information
Showing
1 changed file
with
89 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters