summaryrefslogtreecommitdiff
path: root/Zend/zend_variables.h
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2018-07-04 12:05:51 +0300
committerDmitry Stogov <dmitry@zend.com>2018-07-04 12:05:51 +0300
commit5f19816f533500a7a262b4ccaa9d5a59d25a932b (patch)
tree39d829f819c1af9c2b93bd6bce427795cf48e7b5 /Zend/zend_variables.h
parentd84ef967424343abcc48b8f945d5e7807f1c1e09 (diff)
downloadphp-git-5f19816f533500a7a262b4ccaa9d5a59d25a932b.tar.gz
concat_function() micro optimization
Diffstat (limited to 'Zend/zend_variables.h')
-rw-r--r--Zend/zend_variables.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/Zend/zend_variables.h b/Zend/zend_variables.h
index 154378d71f..ebc6c5b40c 100644
--- a/Zend/zend_variables.h
+++ b/Zend/zend_variables.h
@@ -71,6 +71,16 @@ static zend_always_inline void _zval_opt_copy_ctor(zval *zvalue ZEND_FILE_LINE_D
}
}
+static zend_always_inline void zval_ptr_dtor_str(zval *zval_ptr)
+{
+ if (Z_REFCOUNTED_P(zval_ptr) && !Z_DELREF_P(zval_ptr)) {
+ ZEND_ASSERT(Z_TYPE_P(zval_ptr) == IS_STRING);
+ ZEND_ASSERT(!ZSTR_IS_INTERNED(Z_STR_P(zval_ptr)));
+ ZEND_ASSERT(!(GC_FLAGS(Z_STR_P(zval_ptr)) & IS_STR_PERSISTENT));
+ efree(Z_STR_P(zval_ptr));
+ }
+}
+
ZEND_API void _zval_ptr_dtor(zval *zval_ptr ZEND_FILE_LINE_DC);
ZEND_API void _zval_internal_ptr_dtor(zval *zvalue ZEND_FILE_LINE_DC);
#define zval_copy_ctor(zvalue) _zval_copy_ctor((zvalue) ZEND_FILE_LINE_CC)