Lines Matching refs:elem
44 #define SPL_LLIST_DELREF(elem) if(!--(elem)->rc) { \ argument
45 efree(elem); \
48 #define SPL_LLIST_CHECK_DELREF(elem) if((elem) && !--(elem)->rc) { \ argument
49 efree(elem); \
52 #define SPL_LLIST_ADDREF(elem) (elem)->rc++ argument
53 #define SPL_LLIST_CHECK_ADDREF(elem) if(elem) (elem)->rc++ argument
111 static void spl_ptr_llist_zval_dtor(spl_ptr_llist_element *elem TSRMLS_DC) { /* {{{ */ in spl_ptr_llist_zval_dtor()
112 if (elem->data) { in spl_ptr_llist_zval_dtor()
113 zval_ptr_dtor((zval **)&elem->data); in spl_ptr_llist_zval_dtor()
118 static void spl_ptr_llist_zval_ctor(spl_ptr_llist_element *elem TSRMLS_DC) { /* {{{ */ in spl_ptr_llist_zval_ctor()
119 Z_ADDREF_P((zval *)elem->data); in spl_ptr_llist_zval_ctor()
188 spl_ptr_llist_element *elem = emalloc(sizeof(spl_ptr_llist_element)); in spl_ptr_llist_unshift() local
190 elem->data = data; in spl_ptr_llist_unshift()
191 elem->rc = 1; in spl_ptr_llist_unshift()
192 elem->prev = NULL; in spl_ptr_llist_unshift()
193 elem->next = llist->head; in spl_ptr_llist_unshift()
196 llist->head->prev = elem; in spl_ptr_llist_unshift()
198 llist->tail = elem; in spl_ptr_llist_unshift()
201 llist->head = elem; in spl_ptr_llist_unshift()
205 llist->ctor(elem TSRMLS_CC); in spl_ptr_llist_unshift()
212 spl_ptr_llist_element *elem = emalloc(sizeof(spl_ptr_llist_element)); in spl_ptr_llist_push() local
214 elem->data = data; in spl_ptr_llist_push()
215 elem->rc = 1; in spl_ptr_llist_push()
216 elem->prev = llist->tail; in spl_ptr_llist_push()
217 elem->next = NULL; in spl_ptr_llist_push()
220 llist->tail->next = elem; in spl_ptr_llist_push()
222 llist->head = elem; in spl_ptr_llist_push()
225 llist->tail = elem; in spl_ptr_llist_push()
229 llist->ctor(elem TSRMLS_CC); in spl_ptr_llist_push()
1187 zval *flags, *elem; in SPL_METHOD() local
1217 ALLOC_INIT_ZVAL(elem); in SPL_METHOD()
1218 if (!php_var_unserialize(&elem, &p, s + buf_len, &var_hash TSRMLS_CC)) { in SPL_METHOD()
1219 zval_ptr_dtor(&elem); in SPL_METHOD()
1222 var_push_dtor(&var_hash, &elem); in SPL_METHOD()
1224 spl_ptr_llist_push(intern->llist, elem TSRMLS_CC); in SPL_METHOD()
1268 spl_ptr_llist_element *elem = emalloc(sizeof(spl_ptr_llist_element)); in SPL_METHOD() local
1273 elem->data = value; in SPL_METHOD()
1274 elem->rc = 1; in SPL_METHOD()
1276 elem->next = element; in SPL_METHOD()
1277 elem->prev = element->prev; in SPL_METHOD()
1280 if (elem->prev == NULL) { in SPL_METHOD()
1281 intern->llist->head = elem; in SPL_METHOD()
1283 element->prev->next = elem; in SPL_METHOD()
1285 element->prev = elem; in SPL_METHOD()
1290 intern->llist->ctor(elem TSRMLS_CC); in SPL_METHOD()