Skip to content

Optional SIMD strchrnul #594

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Optional SIMD strchrnul #594

wants to merge 2 commits into from

Conversation

ncruces
Copy link
Contributor

@ncruces ncruces commented Jul 11, 2025

Continuing #580. strchrnul is used by strchr, strcspn and many other places in libc. The implementation is a matchup between strlen and memchr.

@ncruces
Copy link
Contributor Author

ncruces commented Jul 15, 2025

The test for memchr needed a fix: the unsigned to signed pos < length + 2 comparison meant that, depending on compile flags, the inner loop might not run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant