Skip to content

Commit dec3658

Browse files
authored
zend_API: Make array_init() and array_init_size() inline functions (#21905)
1 parent 9e529f4 commit dec3658

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

Zend/zend_API.h

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -524,8 +524,16 @@ ZEND_API const char *zend_get_type_by_const(int type);
524524
#define DLEXPORT
525525
#endif
526526

527-
#define array_init(arg) ZVAL_ARR((arg), zend_new_array(0))
528-
#define array_init_size(arg, size) ZVAL_ARR((arg), zend_new_array(size))
527+
static zend_always_inline void array_init_size(zval *arg, uint32_t size)
528+
{
529+
ZVAL_ARR(arg, zend_new_array(size));
530+
}
531+
532+
static zend_always_inline void array_init(zval *arg)
533+
{
534+
array_init_size(arg, 0);
535+
}
536+
529537
ZEND_API void object_init(zval *arg);
530538
ZEND_API zend_result object_init_ex(zval *arg, zend_class_entry *ce);
531539
ZEND_API zend_result object_init_with_constructor(zval *arg, zend_class_entry *class_type, uint32_t param_count, zval *params, HashTable *named_params);

0 commit comments

Comments
 (0)