summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2015-04-13 18:53:02 +0300
committerDmitry Stogov <dmitry@zend.com>2015-04-13 18:53:02 +0300
commitb8fa90f10fc1ca7bac4c05457aa7a8773049178d (patch)
tree2c9c4eb3f0b4b17c0b186d0c9da00ada60edc476
parent5216da2f01a8fd2aba5fa68415049a92ae8f2284 (diff)
downloadphp-git-b8fa90f10fc1ca7bac4c05457aa7a8773049178d.tar.gz
GC tweaks
-rw-r--r--Zend/zend_gc.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/Zend/zend_gc.c b/Zend/zend_gc.c
index b5c0911cde..47104ef77a 100644
--- a/Zend/zend_gc.c
+++ b/Zend/zend_gc.c
@@ -678,17 +678,14 @@ tail_call:
if (p == end) return count;
}
while (p != end) {
- if (!Z_REFCOUNTED(p->val)) {
+ if (Z_REFCOUNTED(p->val)) {
+ ref = Z_COUNTED(p->val);
+ GC_REFCOUNT(ref)++;
+ count += gc_collect_white(ref);
/* count non-refcounted for compatibility ??? */
- if (Z_TYPE(p->val) != IS_UNDEF && Z_TYPE(p->val) != IS_INDIRECT) {
+ } else if (Z_TYPE(p->val) != IS_UNDEF && Z_TYPE(p->val) != IS_INDIRECT) {
count++;
- }
- p++;
- continue;
}
- ref = Z_COUNTED(p->val);
- GC_REFCOUNT(ref)++;
- count += gc_collect_white(ref);
p++;
}
ref = Z_COUNTED(p->val);
@@ -705,11 +702,12 @@ static int gc_collect_roots(void)
/* remove non-garbage from the list */
while (current != &GC_G(roots)) {
+ gc_root_buffer *next = current->next;
if (GC_REF_GET_COLOR(current->ref) != GC_WHITE) {
GC_REF_SET_ADDRESS(current->ref, 0);
GC_REMOVE_FROM_ROOTS(current);
}
- current = current->next;
+ current = next;
}
current = GC_G(roots).next;