-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Remove unnecassry Zend API macros #6029
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
Conversation
I'd prefer to keep the zval_dtor alias, it used to be used quite heavily. |
b7972a9
to
2f82eb9
Compare
Zend/zend_language_scanner.l
Outdated
@@ -699,7 +699,7 @@ ZEND_API zend_ast *zend_compile_string_to_ast( | |||
zend_restore_lexical_state(&original_lex_state); | |||
CG(in_compilation) = original_in_compilation; | |||
|
|||
zval_dtor(&code_zv); | |||
zval_ptr_dtor_nogc(&code_zv); |
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.
Might as well use zval_ptr_dtor_str(&code_zv)
ext/fileinfo/libmagic/apprentice.c
Outdated
@@ -2597,10 +2597,10 @@ getvalue(struct magic_set *ms, struct magic *m, const char **p, int action) | |||
convert_libmagic_pattern(&pattern, m->value.s, strlen(m->value.s), options); | |||
|
|||
if ((pce = pcre_get_compiled_regex_cache(Z_STR(pattern))) == NULL) { | |||
zval_dtor(&pattern); | |||
zval_ptr_dtor_nogc(&pattern); |
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.
Same here.
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.
Actually, it would be even better if convert_libmagic_pattern were changed to return zend_string*. There's no point in going through a zval here.
win32/signal.c
Outdated
@@ -110,7 +110,7 @@ PHP_FUNCTION(sapi_windows_set_ctrl_handler) | |||
} | |||
|
|||
if (!ZEND_FCI_INITIALIZED(fci)) { | |||
zval_dtor(&ctrl_handler); | |||
zval_ptr_dtor_nogc(&ctrl_handler); |
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.
This should use just zval_ptr_dtor
. Might be circular.
As the last argument of zend_hash_init_ex() is never used
As this API was used extensively previously This reverts commit b752489.
2f82eb9
to
61932ff
Compare
This PR removes APIs provided by Zend via macros as a compatibility layer or to cover up unused arguments.
The only one which had some usage other than
zend_hash_init_ex()
iszval_dtor()
whose expansion iszval_ptr_dtor_nogc()
which seems rather strange and I suppose they should usezval_ptr_dtor()
for the most part.