com php-src: GC tweaks: Zend/zend_gc.c
| From: | Dmitry Stogov | Date: | Mon, 13 Apr 2015 15:53:02 +0000 |
| Subject: | com php-src: GC tweaks: Zend/zend_gc.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-86170@lists.php.net to get a copy of this message | ||
Commit: b8fa90f10fc1ca7bac4c05457aa7a8773049178d
Author: Dmitry Stogov <dmitry@zend.com> Mon, 13 Apr 2015 18:53:02 +0300
Parents: 5216da2f01a8fd2aba5fa68415049a92ae8f2284
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=b8fa90f10fc1ca7bac4c05457aa7a8773049178d
Log:
GC tweaks
Changed paths:
M Zend/zend_gc.c
Diff:
diff --git a/Zend/zend_gc.c b/Zend/zend_gc.c
index b5c0911..47104ef 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;