[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1bdaad61-5267-4cba-bd6b-373d0fee57f4@icloud.com>
Date: Mon, 7 Apr 2025 22:53:58 +0800
From: Zijun Hu <zijun_hu@...oud.com>
To: Andy Shevchenko <andy@...nel.org>
Cc: Kees Cook <kees@...nel.org>, Andrew Morton <akpm@...ux-foundation.org>,
linux-hardening@...r.kernel.org, linux-kernel@...r.kernel.org,
Zijun Hu <quic_zijuhu@...cinc.com>, "Rob Herring (Arm)" <robh@...nel.org>
Subject: Re: [PATCH 1/2] lib/string: Improve strstarts() performance
On 2025/4/7 22:39, Andy Shevchenko wrote:
>> for strstarts(s, "prefix"), strlen("prefix") should *NOT* be compile
>> time constant. it is a loop and unavoidable to have strlen("prefix")
>> iterations.
> What do you mean by that? Compiler uses __builtin_strlen() and it *IS*
> a compile-time constant. Just check it.
thank you Andy for this hints. let me do more investigation about
strlen() within strstarts(s, "prefix").
Powered by blists - more mailing lists