coreboot/src/commonlib
Julius Werner f9ab107d32 commonlib/bsd: Optimize strnlen()
This patch changes the strnlen() implementation to fix a small issue
where we would dereference once more byte than intended when not finding
a NUL-byte within the specified amount of characters. It also changes
the implementation to rely on a pre-calculated end pointer rather than a
running counter, since this seems to lead to slightly better assembly
(one less instruction in the inner loop) on most architectures.

Change-Id: Ic36768fd3a26e2b64143904e78cd0b52ba66898d
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/83933
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
2024-08-19 13:25:05 +00:00
..
bsd commonlib/bsd: Optimize strnlen() 2024-08-19 13:25:05 +00:00
include/commonlib commonlib/include: Include <stdint.h> to fix 'SIZE_MAX' undeclared error 2024-08-13 14:35:16 +00:00
storage tree: Drop unused <string.h> 2024-04-11 11:13:18 +00:00
device_tree.c commonlib/device_tree.c: Remove incorrect warning 2024-08-08 08:08:40 +00:00
fsp_relocate.c commonlib/fsp_relocate: Add PE32+ support 2024-06-21 15:49:38 +00:00
iobuf.c src/commonlib: Clean up includes 2022-10-26 16:27:10 +00:00
list.c treewide: Move list.h to commonlib 2024-02-24 11:49:46 +00:00
Makefile.mk treewide: Move device_tree to commonlib 2024-06-22 04:02:04 +00:00
mem_pool.c commonlib/mem_pool: Allow configuring the alignment 2021-11-04 10:33:52 +00:00
rational.c commonlib: Add support for rational number approximation 2022-08-03 03:26:13 +00:00
region.c src/commonlib: Clean up includes 2022-10-26 16:27:10 +00:00
sort.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00