Lines Matching refs:size
48 zend_long size; member
83 ZEND_ASSERT(array->size > 0); in spl_fixedarray_empty()
86 ZEND_ASSERT(array->size == 0); in spl_fixedarray_empty()
92 array->size = 0; in spl_fixedarray_default_ctor()
108 static void spl_fixedarray_init_non_empty_struct(spl_fixedarray *array, zend_long size) in spl_fixedarray_init_non_empty_struct() argument
110 array->size = 0; /* reset size in case ecalloc() fails */ in spl_fixedarray_init_non_empty_struct()
111 array->elements = size ? safe_emalloc(size, sizeof(zval), 0) : NULL; in spl_fixedarray_init_non_empty_struct()
112 array->size = size; in spl_fixedarray_init_non_empty_struct()
117 static void spl_fixedarray_init(spl_fixedarray *array, zend_long size) in spl_fixedarray_init() argument
119 if (size > 0) { in spl_fixedarray_init()
120 spl_fixedarray_init_non_empty_struct(array, size); in spl_fixedarray_init()
121 spl_fixedarray_init_elems(array, 0, size); in spl_fixedarray_init()
133 ZEND_ASSERT(array->size - offset >= end - begin); in spl_fixedarray_copy_range()
143 zend_long size = from->size; in spl_fixedarray_copy_ctor() local
144 spl_fixedarray_init(to, size); in spl_fixedarray_copy_ctor()
145 if (size != 0) { in spl_fixedarray_copy_ctor()
146 zval *begin = from->elements, *end = from->elements + size; in spl_fixedarray_copy_ctor()
156 array->size = from; in spl_fixedarray_dtor_range()
169 zval *begin = array->elements, *end = array->elements + array->size; in spl_fixedarray_dtor()
171 array->size = 0; in spl_fixedarray_dtor()
179 static void spl_fixedarray_resize(spl_fixedarray *array, zend_long size) in spl_fixedarray_resize() argument
181 if (size == array->size) { in spl_fixedarray_resize()
188 if (array->size == 0) { in spl_fixedarray_resize()
189 spl_fixedarray_init(array, size); in spl_fixedarray_resize()
196 array->cached_resize = size; in spl_fixedarray_resize()
199 array->cached_resize = size; in spl_fixedarray_resize()
202 if (size == 0) { in spl_fixedarray_resize()
205 array->size = 0; in spl_fixedarray_resize()
206 } else if (size > array->size) { in spl_fixedarray_resize()
207 array->elements = safe_erealloc(array->elements, size, sizeof(zval), 0); in spl_fixedarray_resize()
208 spl_fixedarray_init_elems(array, array->size, size); in spl_fixedarray_resize()
209 array->size = size; in spl_fixedarray_resize()
212 spl_fixedarray_dtor_range(array, size, array->size); in spl_fixedarray_resize()
213 array->elements = erealloc(array->elements, sizeof(zval) * size); in spl_fixedarray_resize()
219 if (cached_resize != size) { in spl_fixedarray_resize()
230 *n = (int)intern->array.size; in spl_fixedarray_object_get_gc()
263 for (zend_long i = 0; i < intern->array.size; i++) { in spl_fixedarray_object_get_properties()
267 if (j > intern->array.size) { in spl_fixedarray_object_get_properties()
268 for (zend_long i = intern->array.size; i < j; ++i) { in spl_fixedarray_object_get_properties()
388 if (index < 0 || index >= intern->array.size) { in spl_fixedarray_object_read_dimension_helper()
440 if (index < 0 || index >= intern->array.size) { in spl_fixedarray_object_write_dimension_helper()
481 if (index < 0 || index >= intern->array.size) { in spl_fixedarray_object_unset_dimension_helper()
514 if (index < 0 || index >= intern->array.size) { in spl_fixedarray_object_has_dimension_helper()
556 *count = intern->array.size; in spl_fixedarray_object_count_elements()
565 zend_long size = 0; in PHP_METHOD() local
567 if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &size) == FAILURE) { in PHP_METHOD()
571 if (size < 0) { in PHP_METHOD()
583 spl_fixedarray_init(&intern->array, size); in PHP_METHOD()
596 if (intern->array.size == 0) { in PHP_METHOD()
598 int size = zend_hash_num_elements(intern_ht); in PHP_METHOD() local
600 spl_fixedarray_init(&intern->array, size); in PHP_METHOD()
625 array_init_size(return_value, intern->array.size + num_properties); in PHP_METHOD()
628 for (zend_long i = 0; i < intern->array.size; i++) { in PHP_METHOD()
652 zend_long size; in PHP_METHOD() local
658 if (intern->array.size == 0) { in PHP_METHOD()
659 size = zend_hash_num_elements(data); in PHP_METHOD()
660 spl_fixedarray_init_non_empty_struct(&intern->array, size); in PHP_METHOD()
661 if (!size) { in PHP_METHOD()
666 intern->array.size = 0; in PHP_METHOD()
669 ZVAL_COPY(&intern->array.elements[intern->array.size], elem); in PHP_METHOD()
670 intern->array.size++; in PHP_METHOD()
677 if (intern->array.size != size) { in PHP_METHOD()
678 if (intern->array.size) { in PHP_METHOD()
679 intern->array.elements = erealloc(intern->array.elements, sizeof(zval) * intern->array.size); in PHP_METHOD()
701 RETURN_LONG(intern->array.size); in PHP_METHOD()
716 for (zend_long i = 0; i < intern->array.size; i++) { in PHP_METHOD()
797 RETURN_LONG(intern->array.size); in PHP_METHOD()
804 zend_long size; in PHP_METHOD() local
806 if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &size) == FAILURE) { in PHP_METHOD()
810 if (size < 0) { in PHP_METHOD()
817 spl_fixedarray_resize(&intern->array, size); in PHP_METHOD()
901 array_init_size(return_value, intern->array.size); in PHP_METHOD()
902 for (zend_long i = 0; i < intern->array.size; i++) { in PHP_METHOD()
923 if (iterator->current >= 0 && iterator->current < object->array.size) { in spl_fixedarray_it_valid()