mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
mm: uninline kstrdup()
gcc inlines kstrdup into kstrdup_const() but it can very efficiently tail call into it instead: $ ./scripts/bloat-o-meter ../vmlinux-000 ../obj/vmlinux add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-84 (-84) Function old new delta kstrdup_const 119 35 -84 Link: https://lkml.kernel.org/r/Y/4fDlbIhTLNLFHz@p183 Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
parent
6d51363d53
commit
2a6772ebf0
1 changed files with 1 additions and 0 deletions
|
@ -49,6 +49,7 @@ EXPORT_SYMBOL(kfree_const);
|
||||||
*
|
*
|
||||||
* Return: newly allocated copy of @s or %NULL in case of error
|
* Return: newly allocated copy of @s or %NULL in case of error
|
||||||
*/
|
*/
|
||||||
|
noinline
|
||||||
char *kstrdup(const char *s, gfp_t gfp)
|
char *kstrdup(const char *s, gfp_t gfp)
|
||||||
{
|
{
|
||||||
size_t len;
|
size_t len;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue