summaryrefslogtreecommitdiff
path: root/Zend/zend_variables.h
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/zend_variables.h')
-rw-r--r--Zend/zend_variables.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/Zend/zend_variables.h b/Zend/zend_variables.h
index 282725a325..c55ce233a5 100644
--- a/Zend/zend_variables.h
+++ b/Zend/zend_variables.h
@@ -62,6 +62,28 @@ static zend_always_inline void _zval_opt_copy_ctor(zval *zvalue ZEND_FILE_LINE_D
}
}
+static zend_always_inline void _zval_copy_ctor_no_imm(zval *zvalue ZEND_FILE_LINE_DC)
+{
+ if (Z_REFCOUNTED_P(zvalue)) {
+ if (Z_COPYABLE_P(zvalue)) {
+ _zval_copy_ctor_func(zvalue ZEND_FILE_LINE_RELAY_CC);
+ } else {
+ Z_ADDREF_P(zvalue);
+ }
+ }
+}
+
+static zend_always_inline void _zval_opt_copy_ctor_no_imm(zval *zvalue ZEND_FILE_LINE_DC)
+{
+ if (Z_OPT_REFCOUNTED_P(zvalue)) {
+ if (Z_OPT_COPYABLE_P(zvalue)) {
+ _zval_copy_ctor_func(zvalue ZEND_FILE_LINE_RELAY_CC);
+ } else {
+ Z_ADDREF_P(zvalue);
+ }
+ }
+}
+
ZEND_API int zval_copy_static_var(zval *p TSRMLS_DC, int num_args, va_list args, zend_hash_key *key);
ZEND_API int zend_print_variable(zval *var TSRMLS_DC);
@@ -72,6 +94,8 @@ ZEND_API void _zval_internal_ptr_dtor(zval *zvalue ZEND_FILE_LINE_DC);
ZEND_API void _zval_dtor_wrapper(zval *zvalue);
#define zval_copy_ctor(zvalue) _zval_copy_ctor((zvalue) ZEND_FILE_LINE_CC)
#define zval_opt_copy_ctor(zvalue) _zval_opt_copy_ctor((zvalue) ZEND_FILE_LINE_CC)
+#define zval_copy_ctor_no_imm(zvalue) _zval_copy_ctor_no_imm((zvalue) ZEND_FILE_LINE_CC)
+#define zval_opt_copy_ctor_no_imm(zvalue) _zval_opt_copy_ctor_no_imm((zvalue) ZEND_FILE_LINE_CC)
#define zval_dtor(zvalue) _zval_dtor((zvalue) ZEND_FILE_LINE_CC)
#define zval_ptr_dtor(zval_ptr) _zval_ptr_dtor((zval_ptr) ZEND_FILE_LINE_CC)
#define zval_internal_dtor(zvalue) _zval_internal_dtor((zvalue) ZEND_FILE_LINE_CC)