Lines Matching refs:intern

78 	spl_SplObjectStorage *intern = spl_object_storage_from_obj(object);  in spl_SplObjectStorage_free_storage()  local
80 zend_object_std_dtor(&intern->std); in spl_SplObjectStorage_free_storage()
82 zend_hash_destroy(&intern->storage); in spl_SplObjectStorage_free_storage()
85 static zend_result spl_object_storage_get_hash(zend_hash_key *key, spl_SplObjectStorage *intern, ze… in spl_object_storage_get_hash() argument
86 if (UNEXPECTED(intern->fptr_get_hash)) { in spl_object_storage_get_hash()
91 &intern->std, intern->std.ce, &intern->fptr_get_hash, "getHash", &rv, &param); in spl_object_storage_get_hash()
112 static void spl_object_storage_free_hash(spl_SplObjectStorage *intern, zend_hash_key *key) { in spl_object_storage_free_hash() argument
128 static spl_SplObjectStorageElement* spl_object_storage_get(spl_SplObjectStorage *intern, zend_hash_… in spl_object_storage_get() argument
131 return zend_hash_find_ptr(&intern->storage, key->key); in spl_object_storage_get()
133 return zend_hash_index_find_ptr(&intern->storage, key->h); in spl_object_storage_get()
151 static spl_SplObjectStorageElement *spl_object_storage_attach_handle(spl_SplObjectStorage *intern, … in spl_object_storage_attach_handle() argument
154 zval *entry_zv = zend_hash_index_lookup(&intern->storage, handle); in spl_object_storage_attach_handle()
156 ZEND_ASSERT(!(intern->flags & SOS_OVERRIDDEN_WRITE_DIMENSION)); in spl_object_storage_attach_handle()
180 spl_SplObjectStorageElement *spl_object_storage_attach(spl_SplObjectStorage *intern, zend_object *o… in spl_object_storage_attach() argument
182 if (EXPECTED(!(intern->flags & SOS_OVERRIDDEN_WRITE_DIMENSION))) { in spl_object_storage_attach()
183 return spl_object_storage_attach_handle(intern, obj, inf); in spl_object_storage_attach()
189 if (spl_object_storage_get_hash(&key, intern, obj) == FAILURE) { in spl_object_storage_attach()
193 pelement = spl_object_storage_get(intern, &key); in spl_object_storage_attach()
203 spl_object_storage_free_hash(intern, &key); in spl_object_storage_attach()
217 …pelement = zend_hash_update_mem(&intern->storage, key.key, &element, sizeof(spl_SplObjectStorageEl… in spl_object_storage_attach()
219 …pelement = zend_hash_index_update_mem(&intern->storage, key.h, &element, sizeof(spl_SplObjectStora… in spl_object_storage_attach()
221 spl_object_storage_free_hash(intern, &key); in spl_object_storage_attach()
225 static zend_result spl_object_storage_detach(spl_SplObjectStorage *intern, zend_object *obj) /* {{{… in spl_object_storage_detach() argument
227 if (EXPECTED(!(intern->flags & SOS_OVERRIDDEN_UNSET_DIMENSION))) { in spl_object_storage_detach()
228 return zend_hash_index_del(&intern->storage, obj->handle); in spl_object_storage_detach()
232 if (spl_object_storage_get_hash(&key, intern, obj) == FAILURE) { in spl_object_storage_detach()
236 ret = zend_hash_del(&intern->storage, key.key); in spl_object_storage_detach()
238 ret = zend_hash_index_del(&intern->storage, key.h); in spl_object_storage_detach()
240 spl_object_storage_free_hash(intern, &key); in spl_object_storage_detach()
245 void spl_object_storage_addall(spl_SplObjectStorage *intern, spl_SplObjectStorage *other) { /* {{{ … in spl_object_storage_addall() argument
249 spl_object_storage_attach(intern, element->obj, &element->inf); in spl_object_storage_addall()
252 intern->index = 0; in spl_object_storage_addall()
260 spl_SplObjectStorage *intern; in spl_object_storage_new_ex() local
263 intern = emalloc(sizeof(spl_SplObjectStorage) + zend_object_properties_size(parent)); in spl_object_storage_new_ex()
264 memset(intern, 0, sizeof(spl_SplObjectStorage) - sizeof(zval)); in spl_object_storage_new_ex()
265 intern->pos = 0; in spl_object_storage_new_ex()
267 zend_object_std_init(&intern->std, class_type); in spl_object_storage_new_ex()
268 object_properties_init(&intern->std, class_type); in spl_object_storage_new_ex()
270 zend_hash_init(&intern->storage, 0, NULL, spl_object_storage_dtor, 0); in spl_object_storage_new_ex()
272 intern->std.handlers = &spl_handler_SplObjectStorage; in spl_object_storage_new_ex()
281 intern->fptr_get_hash = get_hash; in spl_object_storage_new_ex()
283 if (intern->fptr_get_hash != NULL || in spl_object_storage_new_ex()
286 intern->flags |= SOS_OVERRIDDEN_READ_DIMENSION; in spl_object_storage_new_ex()
289 if (intern->fptr_get_hash != NULL || in spl_object_storage_new_ex()
291 intern->flags |= SOS_OVERRIDDEN_WRITE_DIMENSION; in spl_object_storage_new_ex()
294 if (intern->fptr_get_hash != NULL || in spl_object_storage_new_ex()
296 intern->flags |= SOS_OVERRIDDEN_UNSET_DIMENSION; in spl_object_storage_new_ex()
307 spl_object_storage_addall(intern, other); in spl_object_storage_new_ex()
310 return &intern->std; in spl_object_storage_new_ex()
329 spl_SplObjectStorage *intern = spl_object_storage_from_obj(obj); in spl_object_storage_debug_info() local
343 ZEND_HASH_FOREACH_PTR(&intern->storage, element) { in spl_object_storage_debug_info()
366 spl_SplObjectStorage *intern = spl_object_storage_from_obj(obj); in spl_object_storage_get_gc() local
370 ZEND_HASH_FOREACH_PTR(&intern->storage, element) { in spl_object_storage_get_gc()
415 bool spl_object_storage_contains(spl_SplObjectStorage *intern, zend_object *obj) /* {{{ */ in spl_object_storage_contains() argument
417 if (EXPECTED(!intern->fptr_get_hash)) { in spl_object_storage_contains()
418 return zend_hash_index_find(&intern->storage, obj->handle) != NULL; in spl_object_storage_contains()
421 if (spl_object_storage_get_hash(&key, intern, obj) == FAILURE) { in spl_object_storage_contains()
426 bool found = zend_hash_exists(&intern->storage, key.key); in spl_object_storage_contains()
438 spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(ZEND_THIS); in PHP_METHOD() local
445 spl_object_storage_attach(intern, obj, inf); in PHP_METHOD()
450 spl_SplObjectStorage *intern = spl_object_storage_from_obj(object); in spl_object_storage_has_dimension() local
451 …if (UNEXPECTED(offset == NULL || Z_TYPE_P(offset) != IS_OBJECT || (intern->flags & SOS_OVERRIDDEN_… in spl_object_storage_has_dimension()
455 …spl_SplObjectStorageElement *element = zend_hash_index_find_ptr(&intern->storage, Z_OBJ_HANDLE_P(o… in spl_object_storage_has_dimension()
469 spl_SplObjectStorage *intern = spl_object_storage_from_obj(object); in spl_object_storage_read_dimension() local
470 …if (UNEXPECTED(offset == NULL || Z_TYPE_P(offset) != IS_OBJECT || (intern->flags & SOS_OVERRIDDEN_… in spl_object_storage_read_dimension()
474 …spl_SplObjectStorageElement *element = zend_hash_index_find_ptr(&intern->storage, Z_OBJ_HANDLE_P(o… in spl_object_storage_read_dimension()
492 spl_SplObjectStorage *intern = spl_object_storage_from_obj(object); in spl_object_storage_write_dimension() local
493 …if (UNEXPECTED(offset == NULL || Z_TYPE_P(offset) != IS_OBJECT || (intern->flags & SOS_OVERRIDDEN_… in spl_object_storage_write_dimension()
497 spl_object_storage_attach_handle(intern, Z_OBJ_P(offset), inf); in spl_object_storage_write_dimension()
502 spl_SplObjectStorage *intern = spl_object_storage_from_obj(object); in spl_object_storage_unset_dimension() local
503 …if (UNEXPECTED(Z_TYPE_P(offset) != IS_OBJECT || (intern->flags & SOS_OVERRIDDEN_UNSET_DIMENSION)))… in spl_object_storage_unset_dimension()
507 zend_hash_index_del(&intern->storage, Z_OBJ_HANDLE_P(offset)); in spl_object_storage_unset_dimension()
514 spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(ZEND_THIS); in PHP_METHOD() local
519 spl_object_storage_detach(intern, obj); in PHP_METHOD()
521 zend_hash_internal_pointer_reset_ex(&intern->storage, &intern->pos); in PHP_METHOD()
522 intern->index = 0; in PHP_METHOD()
543 spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(ZEND_THIS); in PHP_METHOD() local
550 if (spl_object_storage_get_hash(&key, intern, obj) == FAILURE) { in PHP_METHOD()
554 element = spl_object_storage_get(intern, &key); in PHP_METHOD()
555 spl_object_storage_free_hash(intern, &key); in PHP_METHOD()
568 spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(ZEND_THIS); in PHP_METHOD() local
577 spl_object_storage_addall(intern, other); in PHP_METHOD()
579 RETURN_LONG(zend_hash_num_elements(&intern->storage)); in PHP_METHOD()
586 spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(ZEND_THIS); in PHP_METHOD() local
598 if (spl_object_storage_detach(intern, element->obj) == FAILURE) { in PHP_METHOD()
603 zend_hash_internal_pointer_reset_ex(&intern->storage, &intern->pos); in PHP_METHOD()
604 intern->index = 0; in PHP_METHOD()
606 RETURN_LONG(zend_hash_num_elements(&intern->storage)); in PHP_METHOD()
613 spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(ZEND_THIS); in PHP_METHOD() local
623 ZEND_HASH_FOREACH_PTR(&intern->storage, element) { in PHP_METHOD()
625 spl_object_storage_detach(intern, element->obj); in PHP_METHOD()
629 zend_hash_internal_pointer_reset_ex(&intern->storage, &intern->pos); in PHP_METHOD()
630 intern->index = 0; in PHP_METHOD()
632 RETURN_LONG(zend_hash_num_elements(&intern->storage)); in PHP_METHOD()
640 spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(ZEND_THIS); in PHP_METHOD() local
645 RETURN_BOOL(spl_object_storage_contains(intern, obj)); in PHP_METHOD()
651 spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(ZEND_THIS); in PHP_METHOD() local
659 RETURN_LONG(php_count_recursive(&intern->storage)); in PHP_METHOD()
662 RETURN_LONG(zend_hash_num_elements(&intern->storage)); in PHP_METHOD()
668 spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(ZEND_THIS); in PHP_METHOD() local
674 zend_hash_internal_pointer_reset_ex(&intern->storage, &intern->pos); in PHP_METHOD()
675 intern->index = 0; in PHP_METHOD()
681 spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(ZEND_THIS); in PHP_METHOD() local
687 RETURN_BOOL(zend_hash_has_more_elements_ex(&intern->storage, &intern->pos) == SUCCESS); in PHP_METHOD()
693 spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(ZEND_THIS); in PHP_METHOD() local
699 RETURN_LONG(intern->index); in PHP_METHOD()
706 spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(ZEND_THIS); in PHP_METHOD() local
712 if ((element = zend_hash_get_current_data_ptr_ex(&intern->storage, &intern->pos)) == NULL) { in PHP_METHOD()
723 spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(ZEND_THIS); in PHP_METHOD() local
729 if ((element = zend_hash_get_current_data_ptr_ex(&intern->storage, &intern->pos)) == NULL) { in PHP_METHOD()
739 spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(ZEND_THIS); in PHP_METHOD() local
746 if ((element = zend_hash_get_current_data_ptr_ex(&intern->storage, &intern->pos)) == NULL) { in PHP_METHOD()
758 spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(ZEND_THIS); in PHP_METHOD() local
764 zend_hash_move_forward_ex(&intern->storage, &intern->pos); in PHP_METHOD()
765 intern->index++; in PHP_METHOD()
771 spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(ZEND_THIS); in PHP_METHOD() local
787 ZVAL_LONG(&flags, zend_hash_num_elements(&intern->storage)); in PHP_METHOD()
790 zend_hash_internal_pointer_reset_ex(&intern->storage, &pos); in PHP_METHOD()
792 while (zend_hash_has_more_elements_ex(&intern->storage, &pos) == SUCCESS) { in PHP_METHOD()
794 if ((element = zend_hash_get_current_data_ptr_ex(&intern->storage, &pos)) == NULL) { in PHP_METHOD()
809 zend_hash_move_forward_ex(&intern->storage, &pos); in PHP_METHOD()
830 spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(ZEND_THIS); in PHP_METHOD() local
898 if (spl_object_storage_get_hash(&key, intern, Z_OBJ_P(entry)) == FAILURE) { in PHP_METHOD()
902 pelement = spl_object_storage_get(intern, &key); in PHP_METHOD()
903 spl_object_storage_free_hash(intern, &key); in PHP_METHOD()
912 element = spl_object_storage_attach(intern, Z_OBJ_P(entry), Z_ISUNDEF(inf)?NULL:&inf); in PHP_METHOD()
934 object_properties_load(&intern->std, Z_ARRVAL_P(pmembers)); in PHP_METHOD()
949 spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(ZEND_THIS); in PHP_METHOD() local
960 array_init_size(&tmp, 2 * zend_hash_num_elements(&intern->storage)); in PHP_METHOD()
961 ZEND_HASH_FOREACH_PTR(&intern->storage, elem) { in PHP_METHOD()
972 zend_std_get_properties(&intern->std), /* always_duplicate */ 1)); in PHP_METHOD()
979 spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(ZEND_THIS); in PHP_METHOD() local
1010 spl_object_storage_attach(intern, Z_OBJ_P(key), val); in PHP_METHOD()
1017 object_properties_load(&intern->std, Z_ARRVAL_P(members_zv)); in PHP_METHOD()
1037 spl_SplObjectStorage *intern; in PHP_METHOD() local
1044 intern = Z_SPLOBJSTORAGE_P(ZEND_THIS); in PHP_METHOD()
1045 intern->flags = flags; in PHP_METHOD()
1052 spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(ZEND_THIS); in PHP_METHOD() local
1057 RETURN_LONG(intern->flags); in PHP_METHOD()
1064 spl_SplObjectStorage *intern; in PHP_METHOD() local
1065 intern = Z_SPLOBJSTORAGE_P(ZEND_THIS); in PHP_METHOD()
1067 if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &intern->flags) == FAILURE) { in PHP_METHOD()
1076 spl_SplObjectStorage *intern; in PHP_METHOD() local
1089 intern = Z_SPLOBJSTORAGE_P(ZEND_THIS); in PHP_METHOD()
1100 zend_hash_internal_pointer_reset_ex(&intern->storage, &intern->pos); in PHP_METHOD()
1101 while ((element = zend_hash_get_current_data_ptr_ex(&intern->storage, &intern->pos)) != NULL) { in PHP_METHOD()
1106 zend_hash_move_forward_ex(&intern->storage, &intern->pos); in PHP_METHOD()
1109 spl_object_storage_attach(intern, iterator, &zinfo); in PHP_METHOD()
1111 spl_object_storage_attach(intern, iterator, NULL); in PHP_METHOD()
1120 spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(ZEND_THIS); in PHP_METHOD() local
1125 spl_object_storage_detach(intern, Z_OBJ_P(iterator)); in PHP_METHOD()
1127 zend_hash_internal_pointer_reset_ex(&intern->storage, &intern->pos); in PHP_METHOD()
1128 intern->index = 0; in PHP_METHOD()
1135 spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(ZEND_THIS); in PHP_METHOD() local
1140 RETURN_BOOL(spl_object_storage_contains(intern, Z_OBJ_P(iterator))); in PHP_METHOD()
1145 spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(ZEND_THIS); in PHP_METHOD() local
1151 RETURN_LONG(zend_hash_num_elements(&intern->storage)); in PHP_METHOD()
1157 spl_SplObjectStorage *intern; in PHP_METHOD() local
1160 intern = Z_SPLOBJSTORAGE_P(ZEND_THIS); in PHP_METHOD()
1166 zend_hash_internal_pointer_reset_ex(&intern->storage, &intern->pos); in PHP_METHOD()
1167 …while ((element = zend_hash_get_current_data_ptr_ex(&intern->storage, &intern->pos)) != NULL && !E… in PHP_METHOD()
1170 zend_hash_move_forward_ex(&intern->storage, &intern->pos); in PHP_METHOD()
1178 spl_SplObjectStorage *intern; in PHP_METHOD() local
1181 intern = Z_SPLOBJSTORAGE_P(ZEND_THIS); in PHP_METHOD()
1187 zend_hash_internal_pointer_reset_ex(&intern->storage, &intern->pos); in PHP_METHOD()
1188 …while ((element = zend_hash_get_current_data_ptr_ex(&intern->storage, &intern->pos)) != NULL && !E… in PHP_METHOD()
1191 zend_hash_move_forward_ex(&intern->storage, &intern->pos); in PHP_METHOD()
1199 spl_SplObjectStorage *intern; in PHP_METHOD() local
1204 intern = Z_SPLOBJSTORAGE_P(ZEND_THIS); in PHP_METHOD()
1210 if (!zend_hash_num_elements(&intern->storage)) { in PHP_METHOD()
1214 expect = (intern->flags & MIT_NEED_ALL) ? 1 : 0; in PHP_METHOD()
1216 zend_hash_internal_pointer_reset_ex(&intern->storage, &intern->pos); in PHP_METHOD()
1217 …while ((element = zend_hash_get_current_data_ptr_ex(&intern->storage, &intern->pos)) != NULL && !E… in PHP_METHOD()
1232 zend_hash_move_forward_ex(&intern->storage, &intern->pos); in PHP_METHOD()
1239 static void spl_multiple_iterator_get_all(spl_SplObjectStorage *intern, int get_type, zval *return_… in spl_multiple_iterator_get_all() argument
1245 num_elements = zend_hash_num_elements(&intern->storage); in spl_multiple_iterator_get_all()
1254 zend_hash_internal_pointer_reset_ex(&intern->storage, &intern->pos); in spl_multiple_iterator_get_all()
1255 …while ((element = zend_hash_get_current_data_ptr_ex(&intern->storage, &intern->pos)) != NULL && !E… in spl_multiple_iterator_get_all()
1276 } else if (intern->flags & MIT_NEED_ALL) { in spl_multiple_iterator_get_all()
1287 if (intern->flags & MIT_KEYS_ASSOC) { in spl_multiple_iterator_get_all()
1304 zend_hash_move_forward_ex(&intern->storage, &intern->pos); in spl_multiple_iterator_get_all()
1312 spl_SplObjectStorage *intern; in PHP_METHOD() local
1313 intern = Z_SPLOBJSTORAGE_P(ZEND_THIS); in PHP_METHOD()
1319 spl_multiple_iterator_get_all(intern, SPL_MULTIPLE_ITERATOR_GET_ALL_CURRENT, return_value); in PHP_METHOD()
1326 spl_SplObjectStorage *intern; in PHP_METHOD() local
1327 intern = Z_SPLOBJSTORAGE_P(ZEND_THIS); in PHP_METHOD()
1333 spl_multiple_iterator_get_all(intern, SPL_MULTIPLE_ITERATOR_GET_ALL_KEY, return_value); in PHP_METHOD()