-
Notifications
You must be signed in to change notification settings - Fork 7.8k
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
ext/ffi: Various minor refactorings #18176
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything except of zend_string equals APIs looks OK.
zend_ffi_get_func()
was especially manually optimized to reduce overhead of calling native functions.
ext/ffi/ffi.c
Outdated
if (ZSTR_LEN(name) == sizeof("new") -1 | ||
&& (ZSTR_VAL(name)[0] == 'n' || ZSTR_VAL(name)[0] == 'N') | ||
&& (ZSTR_VAL(name)[1] == 'e' || ZSTR_VAL(name)[1] == 'E') | ||
&& (ZSTR_VAL(name)[2] == 'w' || ZSTR_VAL(name)[2] == 'W')) { | ||
if (zend_string_equals_literal_ci(name, "new")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
zend_string_equals_literal_ci() is going to be slower. I would prefer to revert this.
Dropped the zend_strings_equals commit and added another commit to attach your explanation to it. :) |
Commits should be reviewed individually.