cvs: ZendEngine2(PHP_5_3) / zend_gc.c /tests gc_031.phpt

[email protected] ("Dmitry Stogov") Mon, 09 Feb 2009 08:55:23 -0000
Newsgroups php.zend-engine.cvs
Message-ID <cvsdmitry1234169723@cvsserver>
dmitry		Mon Feb  9 08:55:23 2009 UTC

  Modified files:              (Branch: PHP_5_3)
    /ZendEngine2	zend_gc.c 
    /ZendEngine2/tests	gc_031.phpt 
  Log:
  Better fix for #47341
  
  
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_gc.c?r1=1.1.2.19&r2=1.1.2.20&diff_format=u
Index: ZendEngine2/zend_gc.c
diff -u ZendEngine2/zend_gc.c:1.1.2.19 ZendEngine2/zend_gc.c:1.1.2.20
--- ZendEngine2/zend_gc.c:1.1.2.19	Sun Feb  8 19:36:33 2009
+++ ZendEngine2/zend_gc.c	Mon Feb  9 08:55:23 2009
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_gc.c,v 1.1.2.19 2009/02/08 19:36:33 derick Exp $ */
+/* $Id: zend_gc.c,v 1.1.2.20 2009/02/09 08:55:23 dmitry Exp $ */
 
 #include "zend.h"
 #include "zend_API.h"
@@ -51,8 +51,8 @@
 
 	gc_globals->buf = NULL;
 
-	gc_globals->roots.next = NULL;
-	gc_globals->roots.prev = NULL;
+	gc_globals->roots.next = &gc_globals->roots;
+	gc_globals->roots.prev = &gc_globals->roots;
 	gc_globals->unused = NULL;
 	gc_globals->zval_to_free = NULL;
 	gc_globals->free_list = NULL;
@@ -109,10 +109,10 @@
 	GC_G(zobj_marked_grey) = 0;
 #endif
 
-	if (GC_G(buf)) {
-		GC_G(roots).next = &GC_G(roots);
-		GC_G(roots).prev = &GC_G(roots);
+	GC_G(roots).next = &GC_G(roots);
+	GC_G(roots).prev = &GC_G(roots);
 
+	if (GC_G(buf)) {
 		GC_G(unused) = NULL;
 		GC_G(first_unused) = GC_G(buf);
 
@@ -527,7 +527,7 @@
 {
 	int count = 0;
 
-	if (GC_G(roots).next != &GC_G(roots) && GC_G(roots).next) {
+	if (GC_G(roots).next != &GC_G(roots)) {
 		zval_gc_info *p, *q, *orig_free_list, *orig_next_to_free;
 
 		if (GC_G(gc_active)) {
http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/gc_031.phpt?r1=1.1.2.2&r2=1.1.2.3&diff_format=u
Index: ZendEngine2/tests/gc_031.phpt
diff -u ZendEngine2/tests/gc_031.phpt:1.1.2.2 ZendEngine2/tests/gc_031.phpt:1.1.2.3
--- ZendEngine2/tests/gc_031.phpt:1.1.2.2	Sun Feb  8 19:36:33 2009
+++ ZendEngine2/tests/gc_031.phpt	Mon Feb  9 08:55:23 2009
@@ -1,7 +1,7 @@
 --TEST--
 GC 031: gc_collect_roots() with GC turned off.
 --INI--
-zend.gc_enable=1
+zend.enable_gc=0
 --FILE--
 <?php
 gc_collect_cycles();