diff options
author | Nikita Popov <nikic@php.net> | 2014-09-03 15:16:32 +0200 |
---|---|---|
committer | Nikita Popov <nikic@php.net> | 2014-09-03 15:18:06 +0200 |
commit | 9e753531842f524a1a147ca0244c041e59ecd117 (patch) | |
tree | 77f1dbf101b5012bb986f178cdd5379f67b84ec0 /Zend/zend_variables.h | |
parent | c52511c30703d2921f813ccf1557bc042a7cd9d2 (diff) | |
download | php-git-9e753531842f524a1a147ca0244c041e59ecd117.tar.gz |
Use zval_ptr_dtor_nogc to destroy literals
Also move the definition of zval_ptr_dtor_nogc to zend_variables.h
(from zend_execute.h/.c) as it's used in a few places.
Diffstat (limited to 'Zend/zend_variables.h')
-rw-r--r-- | Zend/zend_variables.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Zend/zend_variables.h b/Zend/zend_variables.h index c55ce233a5..538d2a5566 100644 --- a/Zend/zend_variables.h +++ b/Zend/zend_variables.h @@ -36,6 +36,13 @@ static zend_always_inline void _zval_dtor(zval *zvalue ZEND_FILE_LINE_DC) _zval_dtor_func(Z_COUNTED_P(zvalue) ZEND_FILE_LINE_RELAY_CC); } +static zend_always_inline void _zval_ptr_dtor_nogc(zval *zval_ptr ZEND_FILE_LINE_DC) +{ + if (Z_REFCOUNTED_P(zval_ptr) && !Z_DELREF_P(zval_ptr)) { + _zval_dtor_func_for_ptr(Z_COUNTED_P(zval_ptr) ZEND_FILE_LINE_CC); + } +} + ZEND_API void _zval_copy_ctor_func(zval *zvalue ZEND_FILE_LINE_DC); #define zval_copy_ctor_func(zv) _zval_copy_ctor_func(zv ZEND_FILE_LINE_CC) @@ -98,6 +105,7 @@ ZEND_API void _zval_dtor_wrapper(zval *zvalue); #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_ptr_dtor_nogc(zval_ptr) _zval_ptr_dtor_nogc((zval_ptr) ZEND_FILE_LINE_CC) #define zval_internal_dtor(zvalue) _zval_internal_dtor((zvalue) ZEND_FILE_LINE_CC) #define zval_internal_ptr_dtor(zvalue) _zval_internal_ptr_dtor((zvalue) ZEND_FILE_LINE_CC) #define zval_dtor_wrapper _zval_dtor_wrapper |