1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-10-18 02:19:39 +00:00
freebsd/lib
rilysh 86737c5927
Avoid computing strlen() inside loops
Compiling with -O0 (no proper optimizations), strlen() call
in loops for comparing the size, isn't being called/initialized
before the actual loop gets started, which causes n-numbers of
strlen() calls (as long as the string is). Keeping the length
before entering in the loop is a good idea.

On some places, even with -O2, both GCC and Clang can't
recognize this pattern, which seem to happen in an array
of char pointer.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: rilysh <nightquick@proton.me>
Closes #16584
2024-10-02 09:10:06 -07:00
..
libavl cppcheck: explicitly exclude kernel code from userspace checks 2022-05-10 10:20:55 -07:00
libefi Replace P2ALIGN with P2ALIGN_TYPED and delete P2ALIGN. 2024-05-10 08:47:21 -07:00
libicp icp: remove skein module 2024-05-31 15:13:39 -07:00
libnvpair Update all ABI files 2024-10-01 17:10:23 -07:00
libshare Fix handling of DNS names with '-' in them for sharenfs 2024-09-17 13:56:26 -07:00
libspl Add SIMD metadata in /proc on Linux 2024-09-20 08:16:44 -07:00
libtpool tpool_dispatch: fail if it cannot start at least 1 worker. 2024-05-14 09:35:48 -07:00
libunicode cppcheck: explicitly exclude kernel code from userspace checks 2022-05-10 10:20:55 -07:00
libuutil Update all ABI files 2024-10-01 17:10:23 -07:00
libzdb Provide macros for setting and getting blkptr birth times 2024-03-25 15:01:54 -07:00
libzfs Avoid computing strlen() inside loops 2024-10-02 09:10:06 -07:00
libzfs_core Update all ABI files 2024-10-01 17:10:23 -07:00
libzfsbootenv nvpair: Constify string functions 2023-03-14 15:25:50 -07:00
libzpool Add SIMD metadata in /proc on Linux 2024-09-20 08:16:44 -07:00
libzstd libzstd: also build with LIBZPOOL_CPPFLAGS 2024-09-09 14:13:27 -07:00
libzutil Reduce and handle EAGAIN errors on AIO label reads 2024-09-21 10:36:25 -07:00
Makefile.am libzdb: Initial breakout of libzdb 2024-02-05 10:00:41 -08:00