summaryrefslogtreecommitdiff
path: root/Zend/zend_compile.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_compile.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_compile.c')
-rw-r--r--Zend/zend_compile.c18
1 files changed, 1 insertions, 17 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 92de94344d..30c36d92a2 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -3406,22 +3406,6 @@ again:
}
-static void zval_ptr_dtor_internal(zval **zval_ptr)
-{
-#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_dtor(*zval_ptr);
- free(*zval_ptr);
- } else if ((*zval_ptr)->refcount == 1) {
- (*zval_ptr)->is_ref = 0;
- }
-}
-
-#define ZVAL_PTR_DTOR_INTERNAL (void (*)(void *)) zval_ptr_dtor_internal
-
void zend_initialize_class_data(zend_class_entry *ce, zend_bool nullify_handlers TSRMLS_DC)
{
zend_bool persistent_hashes = (ce->type == ZEND_INTERNAL_CLASS) ? 1 : 0;
@@ -3433,7 +3417,7 @@ void zend_initialize_class_data(zend_class_entry *ce, zend_bool nullify_handlers
ce->doc_comment = NULL;
ce->doc_comment_len = 0;
- zend_hash_init_ex(&ce->default_properties, 0, NULL, persistent_hashes ? ZVAL_PTR_DTOR_INTERNAL : ZVAL_PTR_DTOR, persistent_hashes, 0);
+ zend_hash_init_ex(&ce->default_properties, 0, NULL, persistent_hashes ? ZVAL_INTERNAL_PTR_DTOR : ZVAL_PTR_DTOR, persistent_hashes, 0);
zend_hash_init_ex(&ce->properties_info, 0, NULL, (dtor_func_t) (persistent_hashes ? zend_destroy_property_info_internal : zend_destroy_property_info), persistent_hashes, 0);
if (persistent_hashes) {