mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Make empty_fcall_info and empty_fcall_info_cache macros
See https://github.com/php/php-src/pull/18273, a constant may cause unnecessary cache misses. Closes GH-18326
This commit is contained in:
parent
3b87093bff
commit
16c4c066f4
2 changed files with 8 additions and 7 deletions
|
@ -690,8 +690,13 @@ ZEND_API zend_result _call_user_function_impl(zval *object, zval *function_name,
|
|||
#define call_user_function_named(function_table, object, function_name, retval_ptr, param_count, params, named_params) \
|
||||
_call_user_function_impl(object, function_name, retval_ptr, param_count, params, named_params)
|
||||
|
||||
ZEND_API extern const zend_fcall_info empty_fcall_info;
|
||||
ZEND_API extern const zend_fcall_info_cache empty_fcall_info_cache;
|
||||
#ifndef __cplusplus
|
||||
# define empty_fcall_info (zend_fcall_info) {0}
|
||||
# define empty_fcall_info_cache (zend_fcall_info_cache) {0}
|
||||
#else
|
||||
# define empty_fcall_info zend_fcall_info {0}
|
||||
# define empty_fcall_info_cache zend_fcall_info_cache {0}
|
||||
#endif
|
||||
|
||||
/** Build zend_call_info/cache from a zval*
|
||||
*
|
||||
|
@ -800,7 +805,7 @@ static zend_always_inline void zend_fcc_dtor(zend_fcall_info_cache *fcc)
|
|||
if (fcc->closure) {
|
||||
OBJ_RELEASE(fcc->closure);
|
||||
}
|
||||
memcpy(fcc, &empty_fcall_info_cache, sizeof(zend_fcall_info_cache));
|
||||
*fcc = empty_fcall_info_cache;
|
||||
}
|
||||
|
||||
ZEND_API void zend_get_callable_zval_from_fcc(const zend_fcall_info_cache *fcc, zval *callable);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue