diff options
author | Anatol Belski <ab@php.net> | 2014-10-06 18:36:26 +0200 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2014-10-06 18:36:26 +0200 |
commit | bd9f17846df5ca7c7f606e4392f02861523b7cd5 (patch) | |
tree | 280d445b62fb1a0d5655facdeb554184e665d3fc /Zend/zend_string.h | |
parent | 60f0695a0982c556c826191d28c8ba3a72fd2a2b (diff) | |
parent | 5d7ccb758b407d1ba6bc7502b22ebb7cfcd2912c (diff) | |
download | php-git-bd9f17846df5ca7c7f606e4392f02861523b7cd5.tar.gz |
Merge remote-tracking branch 'origin/master' into native-tls
* origin/master:
bring back the correct php_version.h
fix the empty_strings SAPI shutdown leak in TS build
Use fastcall calling convention for heap functions
fix leaking the empty_string in TS builds
remove successive assignment
Diffstat (limited to 'Zend/zend_string.h')
-rw-r--r-- | Zend/zend_string.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/Zend/zend_string.h b/Zend/zend_string.h index d30e14b5b3..1da3b511c0 100644 --- a/Zend/zend_string.h +++ b/Zend/zend_string.h @@ -282,6 +282,30 @@ EMPTY_SWITCH_DEFAULT_CASE() return hash; } +static zend_always_inline void zend_interned_empty_string_init(zend_string **s TSRMLS_DC) +{ + zend_string *str; + + str = zend_string_alloc(sizeof("")-1, 1); + str->val[0] = '\000'; + +#ifndef ZTS + *s = zend_new_interned_string(str TSRMLS_CC); +#else + zend_string_hash_val(str); + str->gc.u.v.flags |= IS_STR_INTERNED; + *s = str; +#endif +} + +static zend_always_inline void zend_interned_empty_string_free(zend_string **s TSRMLS_DC) +{ + if (NULL != *s) { + free(*s); + *s = NULL; + } +} + #endif /* ZEND_STRING_H */ /* |