Skip to content

Commit 8993422

Browse files
committed
Remove zend_fcall_info_argn() and zend_fcall_info_argv()
Usage of these function heap allocates the zvals when they can already be used directly with an FCI
1 parent 000b314 commit 8993422

File tree

3 files changed

+2
-39
lines changed

3 files changed

+2
-39
lines changed

UPGRADING.INTERNALS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ PHP 8.3 INTERNALS UPGRADE NOTES
2121
- zend_fcall_info_call()
2222
- zend_fcall_info_args_save()
2323
- zend_fcall_info_args_restore()
24+
- zend_fcall_info_argn()
25+
- zend_fcall_info_argv()
2426

2527
========================
2628
2. Build system changes

Zend/zend_API.c

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4076,33 +4076,6 @@ ZEND_API void zend_fcall_info_argp(zend_fcall_info *fci, uint32_t argc, zval *ar
40764076
}
40774077
/* }}} */
40784078

4079-
ZEND_API void zend_fcall_info_argv(zend_fcall_info *fci, uint32_t argc, va_list *argv) /* {{{ */
4080-
{
4081-
zend_fcall_info_args_clear(fci, !argc);
4082-
4083-
if (argc) {
4084-
zval *arg;
4085-
fci->param_count = argc;
4086-
fci->params = (zval *) erealloc(fci->params, fci->param_count * sizeof(zval));
4087-
4088-
for (uint32_t i = 0; i < argc; ++i) {
4089-
arg = va_arg(*argv, zval *);
4090-
ZVAL_COPY(&fci->params[i], arg);
4091-
}
4092-
}
4093-
}
4094-
/* }}} */
4095-
4096-
ZEND_API void zend_fcall_info_argn(zend_fcall_info *fci, uint32_t argc, ...) /* {{{ */
4097-
{
4098-
va_list argv;
4099-
4100-
va_start(argv, argc);
4101-
zend_fcall_info_argv(fci, argc, &argv);
4102-
va_end(argv);
4103-
}
4104-
/* }}} */
4105-
41064079
ZEND_API const char *zend_get_module_version(const char *module_name) /* {{{ */
41074080
{
41084081
zend_string *lname;

Zend/zend_API.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -702,18 +702,6 @@ ZEND_API zend_result zend_fcall_info_args_ex(zend_fcall_info *fci, zend_function
702702
*/
703703
ZEND_API void zend_fcall_info_argp(zend_fcall_info *fci, uint32_t argc, zval *argv);
704704

705-
/** Set arguments in the zend_fcall_info struct taking care of refcount.
706-
* If argc is 0 the arguments which are set will be cleared, else pass
707-
* a variable amount of zval** arguments.
708-
*/
709-
ZEND_API void zend_fcall_info_argv(zend_fcall_info *fci, uint32_t argc, va_list *argv);
710-
711-
/** Set arguments in the zend_fcall_info struct taking care of refcount.
712-
* If argc is 0 the arguments which are set will be cleared, else pass
713-
* a variable amount of zval** arguments.
714-
*/
715-
ZEND_API void zend_fcall_info_argn(zend_fcall_info *fci, uint32_t argc, ...);
716-
717705
/* Can only return FAILURE if EG(active) is false during late engine shutdown.
718706
* If the call or call setup throws, EG(exception) will be set and the retval
719707
* will be UNDEF. Otherwise, the retval will be a non-UNDEF value. */

0 commit comments

Comments
 (0)