diff options
author | Zeev Suraski <zeev@php.net> | 1999-04-18 15:11:52 +0000 |
---|---|---|
committer | Zeev Suraski <zeev@php.net> | 1999-04-18 15:11:52 +0000 |
commit | 342c6e0b2328db952709dd5a35c113e2b17c1e3d (patch) | |
tree | a43236d5e2474a8f55a6e5cb9ebd262da5374770 /Zend/zend_llist.c | |
parent | 2e8fb4e329bf98eb33dffad4c5fb1b49f73e7517 (diff) | |
download | php-git-342c6e0b2328db952709dd5a35c113e2b17c1e3d.tar.gz |
Whatnot:
* updated alloc_persist to use critical sections
* changed extension shutdown to two-phase
* updated dependencies
* PR support (don't remember if there was any really)
Diffstat (limited to 'Zend/zend_llist.c')
-rw-r--r-- | Zend/zend_llist.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/Zend/zend_llist.c b/Zend/zend_llist.c index ec19038dd0..2a659cef88 100644 --- a/Zend/zend_llist.c +++ b/Zend/zend_llist.c @@ -72,18 +72,26 @@ ZEND_API void zend_llist_del_element(zend_llist *l, void *element) ZEND_API void zend_llist_destroy(zend_llist *l) { - zend_llist_element *current=l->head, *next; + zend_llist_element *current, *next; - while (current) { - next = current->next; - if (l->dtor) { + if (l->dtor) { + current = l->head; + + while (current) { l->dtor(current->data); + current = current->next; } + } + + current = l->head; + while (current) { + next = current->next; pefree(current, l->persistent); current = next; } } + ZEND_API void zend_llist_remove_tail(zend_llist *l) { zend_llist_element *old_tail; |