summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2014-03-19 17:00:28 +0400
committerDmitry Stogov <dmitry@zend.com>2014-03-19 17:00:28 +0400
commitb7938ab1bd765897bd6f08a48a8aea494a961ea9 (patch)
tree22f8034d42dfac8f03b4bb6d6573e5a7f6361ac8 /ext
parent2e3e96b24bb1c547362af53b952f823f451e6bce (diff)
downloadphp-git-b7938ab1bd765897bd6f08a48a8aea494a961ea9.tar.gz
Refactored GC (incomplete)
Diffstat (limited to 'ext')
-rw-r--r--ext/date/php_date.c4
-rw-r--r--ext/reflection/php_reflection.c1
-rw-r--r--ext/spl/spl_array.c1
-rw-r--r--ext/spl/spl_directory.c1
-rw-r--r--ext/spl/spl_dllist.c1
-rw-r--r--ext/spl/spl_fixedarray.c1
-rw-r--r--ext/spl/spl_heap.c1
-rw-r--r--ext/spl/spl_iterators.c2
-rw-r--r--ext/spl/spl_observer.c1
-rw-r--r--ext/standard/array.c4
10 files changed, 14 insertions, 3 deletions
diff --git a/ext/date/php_date.c b/ext/date/php_date.c
index 65fe5c46ed..8c08ddba20 100644
--- a/ext/date/php_date.c
+++ b/ext/date/php_date.c
@@ -2440,6 +2440,7 @@ static void date_object_free_storage_date(zend_object *object TSRMLS_DC) /* {{{
}
zend_object_std_dtor(&intern->std TSRMLS_CC);
+ GC_REMOVE_FROM_BUFFER(object);
efree(intern);
} /* }}} */
@@ -2451,6 +2452,7 @@ static void date_object_free_storage_timezone(zend_object *object TSRMLS_DC) /*
free(intern->tzi.z.abbr);
}
zend_object_std_dtor(&intern->std TSRMLS_CC);
+ GC_REMOVE_FROM_BUFFER(object);
efree(intern);
} /* }}} */
@@ -2460,6 +2462,7 @@ static void date_object_free_storage_interval(zend_object *object TSRMLS_DC) /*
timelib_rel_time_dtor(intern->diff);
zend_object_std_dtor(&intern->std TSRMLS_CC);
+ GC_REMOVE_FROM_BUFFER(object);
efree(intern);
} /* }}} */
@@ -2481,6 +2484,7 @@ static void date_object_free_storage_period(zend_object *object TSRMLS_DC) /* {{
timelib_rel_time_dtor(intern->interval);
zend_object_std_dtor(&intern->std TSRMLS_CC);
+ GC_REMOVE_FROM_BUFFER(object);
efree(intern);
} /* }}} */
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index 9c822029fe..148dae4378 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -319,6 +319,7 @@ static void reflection_free_objects_storage(zend_object *object TSRMLS_DC) /* {{
intern->ptr = NULL;
zval_ptr_dtor(&intern->obj);
zend_object_std_dtor(object TSRMLS_CC);
+ GC_REMOVE_FROM_BUFFER(object);
efree(intern);
}
/* }}} */
diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c
index 82f166fe6d..c6634ecf8a 100644
--- a/ext/spl/spl_array.c
+++ b/ext/spl/spl_array.c
@@ -170,6 +170,7 @@ static void spl_array_object_free_storage(zend_object *object TSRMLS_DC)
efree(intern->debug_info);
}
+ GC_REMOVE_FROM_BUFFER(object);
efree(intern);
}
/* }}} */
diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c
index b86994c7d2..86d745463f 100644
--- a/ext/spl/spl_directory.c
+++ b/ext/spl/spl_directory.c
@@ -127,6 +127,7 @@ static void spl_filesystem_object_free_storage(zend_object *object TSRMLS_DC) /*
//????zend_iterator_dtor(&intern->it->intern);
}
+ GC_REMOVE_FROM_BUFFER(object);
efree(intern);
} /* }}} */
diff --git a/ext/spl/spl_dllist.c b/ext/spl/spl_dllist.c
index 8f444d0061..f453ba7175 100644
--- a/ext/spl/spl_dllist.c
+++ b/ext/spl/spl_dllist.c
@@ -367,6 +367,7 @@ static void spl_dllist_object_free_storage(zend_object *object TSRMLS_DC) /* {{{
efree(intern->debug_info);
}
+ GC_REMOVE_FROM_BUFFER(object);
efree(intern);
}
/* }}} */
diff --git a/ext/spl/spl_fixedarray.c b/ext/spl/spl_fixedarray.c
index 0a8b8502fd..784d1db968 100644
--- a/ext/spl/spl_fixedarray.c
+++ b/ext/spl/spl_fixedarray.c
@@ -210,6 +210,7 @@ static void spl_fixedarray_object_free_storage(zend_object *object TSRMLS_DC) /*
zend_object_std_dtor(&intern->std TSRMLS_CC);
zval_ptr_dtor(&intern->retval);
+ GC_REMOVE_FROM_BUFFER(object);
efree(intern);
}
/* }}} */
diff --git a/ext/spl/spl_heap.c b/ext/spl/spl_heap.c
index 969fdba736..5358e3da9d 100644
--- a/ext/spl/spl_heap.c
+++ b/ext/spl/spl_heap.c
@@ -378,6 +378,7 @@ static void spl_heap_object_free_storage(zend_object *object TSRMLS_DC) /* {{{ *
efree(intern->debug_info);
}
+ GC_REMOVE_FROM_BUFFER(object);
efree(intern);
}
/* }}} */
diff --git a/ext/spl/spl_iterators.c b/ext/spl/spl_iterators.c
index 55587c48af..f424491966 100644
--- a/ext/spl/spl_iterators.c
+++ b/ext/spl/spl_iterators.c
@@ -889,6 +889,7 @@ static void spl_RecursiveIteratorIterator_free_storage(zend_object *_object TSRM
smart_str_free(&object->postfix[0]);
+ GC_REMOVE_FROM_BUFFER(_object);
efree(object);
}
/* }}} */
@@ -2268,6 +2269,7 @@ static void spl_dual_it_free_storage(zend_object *_object TSRMLS_DC)
//zend_object_std_dtor(&object->std TSRMLS_CC);
+ GC_REMOVE_FROM_BUFFER(_object);
efree(object);
}
/* }}} */
diff --git a/ext/spl/spl_observer.c b/ext/spl/spl_observer.c
index 803ca4a59c..3728e45005 100644
--- a/ext/spl/spl_observer.c
+++ b/ext/spl/spl_observer.c
@@ -114,6 +114,7 @@ void spl_SplObjectStorage_free_storage(zend_object *object TSRMLS_DC) /* {{{ */
efree(intern->debug_info);
}
+ GC_REMOVE_FROM_BUFFER(object);
efree(intern);
} /* }}} */
diff --git a/ext/standard/array.c b/ext/standard/array.c
index cb3aa761bc..ab16b67ee0 100644
--- a/ext/standard/array.c
+++ b/ext/standard/array.c
@@ -2258,9 +2258,7 @@ PHPAPI int php_array_merge(HashTable *dest, HashTable *src, int recursive TSRMLS
if (Z_ISREF_P(dest_entry)) {
if (Z_REFCOUNT_P(dest_entry) == 1) {
- zend_reference *ref = Z_REF_P(dest_entry);
- ZVAL_COPY_VALUE(dest_entry, dest_zval);
- efree(ref);
+ ZVAL_UNREF(dest_entry);
} else {
Z_DELREF_P(dest_entry);
ZVAL_DUP(dest_entry, dest_zval);