diff options
author | Dmitry Stogov <dmitry@zend.com> | 2018-05-28 16:27:12 +0300 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2018-05-28 16:27:12 +0300 |
commit | 5eb1f92f31cafc48384f9096012f421b37f6d425 (patch) | |
tree | 4ed67b92229407e7b5cbab37b96428fe80eb3f94 /Zend/zend_string.h | |
parent | 925f05dd1a35eafa71eb29abb69cdfc31a23a75d (diff) | |
download | php-git-5eb1f92f31cafc48384f9096012f421b37f6d425.tar.gz |
Use zend_string_release_ex() instread of zend_string_release() in places, where we sure about string persistence.
Diffstat (limited to 'Zend/zend_string.h')
-rw-r--r-- | Zend/zend_string.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Zend/zend_string.h b/Zend/zend_string.h index d517b74020..78de28f7f4 100644 --- a/Zend/zend_string.h +++ b/Zend/zend_string.h @@ -281,6 +281,21 @@ static zend_always_inline void zend_string_release(zend_string *s) } } +static zend_always_inline void zend_string_release_ex(zend_string *s, int persistent) +{ + if (!ZSTR_IS_INTERNED(s)) { + if (GC_DELREF(s) == 0) { + if (persistent) { + ZEND_ASSERT(GC_FLAGS(s) & IS_STR_PERSISTENT); + free(s); + } else { + ZEND_ASSERT(!(GC_FLAGS(s) & IS_STR_PERSISTENT)); + efree(s); + } + } + } +} + #if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) ZEND_API zend_bool ZEND_FASTCALL zend_string_equal_val(zend_string *s1, zend_string *s2); #else |