Skip to content
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

Avoid allocation in zend_enum_get_case_cstr() #18239

Merged
merged 1 commit into from
Apr 4, 2025

Conversation

nielsdos
Copy link
Member

@nielsdos nielsdos commented Apr 3, 2025

Future uses of this internal API are planned, and we can easily avoid an allocation by factoring out the common code.

Verified

This commit was signed with the committer’s verified signature.
nielsdos Niels Dossche
Future uses of this internal API are planned, and we can easily avoid an
allocation by factoring out the common code.
@nielsdos nielsdos marked this pull request as ready for review April 3, 2025 19:02
@nielsdos nielsdos requested a review from iluuu1994 April 3, 2025 19:02
Copy link
Member

@Girgias Girgias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MSTM.

Follow-up, maybe there should be a new ZEND_API that takes a C string with its length to prevent the strlen() computation for literal strings?

Copy link
Member

@iluuu1994 iluuu1994 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

@nielsdos
Copy link
Member Author

nielsdos commented Apr 4, 2025

Follow-up, maybe there should be a new ZEND_API that takes a C string with its length to prevent the strlen() computation for literal strings?

Sure. Will do that for my other work that prompted this PR (soon).

@nielsdos nielsdos merged commit d80682e into php:master Apr 4, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants