HomeFreeBSD

libc/amd64: rewrite memrchr() baseline impl. to read the string from the back

Description

libc/amd64: rewrite memrchr() baseline impl. to read the string from the back

This ensures O(1) behaviour if the character is a constant offset
from the end of the string, regardless of how long the string is.

Reported by: Mikael Simonsson <m@mikaelsimonsson.com>
Reviewed by: benni
PR: 288321
MFC after: 1 month

Details

Provenance
fuzAuthored on Jul 29 2025, 8:12 PM
Parents
rG60fce0e22147: busdma: another fix for small bounce transfers
Branches
Unknown
Tags
Unknown