com php-src: Improved GC compatibility: Zend/zend_gc.c

From: Date: Wed, 19 Mar 2014 20:29:20 +0000
Subject: com php-src: Improved GC compatibility: Zend/zend_gc.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-77594@lists.php.net to get a copy of this message
Commit: 2909c72b69fd1bb98fc2955636fbdfc45053fe15 Author: Dmitry Stogov <dmitry@zend.com> Thu, 20 Mar 2014 00:29:20 +0400 Parents: 3c0feb51bc16626aabae983444934dc4b6328b2f Branches: phpng Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=2909c72b69fd1bb98fc2955636fbdfc45053fe15 Log: Improved GC compatibility Changed paths: M Zend/zend_gc.c Diff: diff --git a/Zend/zend_gc.c b/Zend/zend_gc.c index 00e50e1..bea503e 100644 --- a/Zend/zend_gc.c +++ b/Zend/zend_gc.c @@ -22,7 +22,8 @@ #include "zend.h" #include "zend_API.h" -#define GC_ROOT_BUFFER_MAX_ENTRIES 10000 +/* one (0) is reserved */ +#define GC_ROOT_BUFFER_MAX_ENTRIES 10001 #ifdef ZTS ZEND_API int gc_globals_id; @@ -381,9 +382,9 @@ static void gc_mark_roots(TSRMLS_D) while (current != &GC_G(roots)) { if (GC_GET_COLOR(current->ref->u.v.gc_info) == GC_PURPLE) { gc_mark_grey(current->ref TSRMLS_CC); - } else { - GC_SET_ADDRESS(current->ref->u.v.gc_info, 0); - GC_REMOVE_FROM_ROOTS(current); +//??? } else { +//??? GC_SET_ADDRESS(current->ref->u.v.gc_info, 0); +//??? GC_REMOVE_FROM_ROOTS(current); } current = current->next; } @@ -506,7 +507,13 @@ tail_call: ZVAL_OBJ(&tmp, obj); props = get_gc(&tmp, &table, &n TSRMLS_CC); - while (n > 0 && !Z_REFCOUNTED(table[n-1])) n--; + while (n > 0 && !Z_REFCOUNTED(table[n-1])) { + /* count non-refcounted for compatibilty ??? */ + if (Z_TYPE(table[n-1]) != IS_UNDEF) { + count++; + } + n--; + } for (i = 0; i < n; i++) { if (Z_REFCOUNTED(table[i])) { ref = Z_COUNTED(table[i]); @@ -518,7 +525,10 @@ tail_call: } else { count += gc_collect_white(ref TSRMLS_CC); } - } + /* count non-refcounted for compatibilty ??? */ + } else if (Z_TYPE(table[i]) != IS_UNDEF) { + count++; + } } if (!props) { return count; @@ -545,7 +555,13 @@ tail_call: if (!ht) return count; for (idx = 0; idx < ht->nNumUsed; idx++) { p = ht->arData + idx; - if (!Z_REFCOUNTED(p->val)) continue; + if (!Z_REFCOUNTED(p->val)) { + /* count non-refcounted for compatibilty ??? */ + if (Z_TYPE(p->val) != IS_UNDEF) { + count++; + } + continue; + } ref = Z_COUNTED(p->val); if (ref->u.v.type != IS_ARRAY || (zend_array*)ref != &EG(symbol_table)) { ref->refcount++;

« previous php.cvs (#77594) next »