summaryrefslogtreecommitdiff
path: root/Zend/zend_execute_API.c
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2003-08-24 17:32:47 +0000
committerMarcus Boerger <helly@php.net>2003-08-24 17:32:47 +0000
commit19ec7a09fc332d1430bd1488861ef72cb227fca6 (patch)
tree4daef239378b7fc77c1e0bc952aea7c77dc04dc6 /Zend/zend_execute_API.c
parentcec053f70763e9974b48836e37adcc03a8f052b6 (diff)
downloadphp-git-19ec7a09fc332d1430bd1488861ef72cb227fca6.tar.gz
- Provide appropriate way to destroy internal zval's.
- Allow internal zval's of type string and disallow complex types. - Define the default string for extensions at class level instead of ctor.
Diffstat (limited to 'Zend/zend_execute_API.c')
-rw-r--r--Zend/zend_execute_API.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c
index 28f7347b30..39dea80c74 100644
--- a/Zend/zend_execute_API.c
+++ b/Zend/zend_execute_API.c
@@ -359,6 +359,21 @@ ZEND_API void _zval_ptr_dtor(zval **zval_ptr ZEND_FILE_LINE_DC)
}
+ZEND_API void _zval_internal_ptr_dtor(zval **zval_ptr ZEND_FILE_LINE_DC)
+{
+#if DEBUG_ZEND>=2
+ printf("Reducing refcount for %x (%x): %d->%d\n", *zval_ptr, zval_ptr, (*zval_ptr)->refcount, (*zval_ptr)->refcount-1);
+#endif
+ (*zval_ptr)->refcount--;
+ if ((*zval_ptr)->refcount==0) {
+ zval_internal_dtor(*zval_ptr);
+ free(*zval_ptr);
+ } else if ((*zval_ptr)->refcount == 1) {
+ (*zval_ptr)->is_ref = 0;
+ }
+}
+
+
ZEND_API int zend_is_true(zval *op)
{
return i_zend_is_true(op);