Lines Matching refs:elem

42 #define SPL_LLIST_DELREF(elem) if(!--(elem)->rc) { \  argument
43 efree(elem); \
46 #define SPL_LLIST_CHECK_DELREF(elem) if((elem) && !--(elem)->rc) { \ argument
47 efree(elem); \
50 #define SPL_LLIST_ADDREF(elem) (elem)->rc++ argument
51 #define SPL_LLIST_CHECK_ADDREF(elem) if(elem) (elem)->rc++ argument
115 static void spl_ptr_llist_zval_dtor(spl_ptr_llist_element *elem) { /* {{{ */ in spl_ptr_llist_zval_dtor() argument
116 if (!Z_ISUNDEF(elem->data)) { in spl_ptr_llist_zval_dtor()
117 zval_ptr_dtor(&elem->data); in spl_ptr_llist_zval_dtor()
118 ZVAL_UNDEF(&elem->data); in spl_ptr_llist_zval_dtor()
123 static void spl_ptr_llist_zval_ctor(spl_ptr_llist_element *elem) { /* {{{ */ in spl_ptr_llist_zval_ctor() argument
124 if (Z_REFCOUNTED(elem->data)) { in spl_ptr_llist_zval_ctor()
125 Z_ADDREF(elem->data); in spl_ptr_llist_zval_ctor()
195 spl_ptr_llist_element *elem = emalloc(sizeof(spl_ptr_llist_element)); in spl_ptr_llist_unshift() local
197 elem->rc = 1; in spl_ptr_llist_unshift()
198 elem->prev = NULL; in spl_ptr_llist_unshift()
199 elem->next = llist->head; in spl_ptr_llist_unshift()
200 ZVAL_COPY_VALUE(&elem->data, data); in spl_ptr_llist_unshift()
203 llist->head->prev = elem; in spl_ptr_llist_unshift()
205 llist->tail = elem; in spl_ptr_llist_unshift()
208 llist->head = elem; in spl_ptr_llist_unshift()
212 llist->ctor(elem); in spl_ptr_llist_unshift()
219 spl_ptr_llist_element *elem = emalloc(sizeof(spl_ptr_llist_element)); in spl_ptr_llist_push() local
221 elem->rc = 1; in spl_ptr_llist_push()
222 elem->prev = llist->tail; in spl_ptr_llist_push()
223 elem->next = NULL; in spl_ptr_llist_push()
224 ZVAL_COPY_VALUE(&elem->data, data); in spl_ptr_llist_push()
227 llist->tail->next = elem; in spl_ptr_llist_push()
229 llist->head = elem; in spl_ptr_llist_push()
232 llist->tail = elem; in spl_ptr_llist_push()
236 llist->ctor(elem); in spl_ptr_llist_push()
1174 zval *flags, *elem; in SPL_METHOD() local
1208 elem = var_tmp_var(&var_hash); in SPL_METHOD()
1209 if (!php_var_unserialize(elem, &p, s + buf_len, &var_hash)) { in SPL_METHOD()
1212 var_push_dtor(&var_hash, elem); in SPL_METHOD()
1214 spl_ptr_llist_push(intern->llist, elem); in SPL_METHOD()
1258 spl_ptr_llist_element *elem = emalloc(sizeof(spl_ptr_llist_element)); in SPL_METHOD() local
1263 ZVAL_COPY_VALUE(&elem->data, value); in SPL_METHOD()
1264 elem->rc = 1; in SPL_METHOD()
1266 elem->next = element; in SPL_METHOD()
1267 elem->prev = element->prev; in SPL_METHOD()
1270 if (elem->prev == NULL) { in SPL_METHOD()
1271 intern->llist->head = elem; in SPL_METHOD()
1273 element->prev->next = elem; in SPL_METHOD()
1275 element->prev = elem; in SPL_METHOD()
1280 intern->llist->ctor(elem); in SPL_METHOD()