summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2018-01-17 01:58:51 +0300
committerDmitry Stogov <dmitry@zend.com>2018-01-17 01:58:51 +0300
commit5c77bac9a74de2e1a16bae22a6f338380f5dc202 (patch)
tree8b26546d0553adbb87ae23326f19168ab1517601
parent60fb58799fc6c537dd82bb9f5a1e8eeb87bf0ecf (diff)
downloadphp-git-5c77bac9a74de2e1a16bae22a6f338380f5dc202.tar.gz
A cheaper way to reset type flags.
-rw-r--r--Zend/zend_API.c2
-rw-r--r--Zend/zend_compile.c2
-rw-r--r--ext/opcache/zend_persist.c6
-rw-r--r--ext/opcache/zend_persist_calc.c2
-rw-r--r--ext/standard/browscap.c6
5 files changed, 9 insertions, 9 deletions
diff --git a/Zend/zend_API.c b/Zend/zend_API.c
index 73eb748e19..79d6ab9a6c 100644
--- a/Zend/zend_API.c
+++ b/Zend/zend_API.c
@@ -3624,7 +3624,7 @@ static inline zend_string *zval_make_interned_string(zval *zv) /* {{{ */
ZEND_ASSERT(Z_TYPE_P(zv) == IS_STRING);
Z_STR_P(zv) = zend_new_interned_string(Z_STR_P(zv));
if (ZSTR_IS_INTERNED(Z_STR_P(zv))) {
- Z_TYPE_FLAGS_P(zv) &= ~ (IS_TYPE_REFCOUNTED | IS_TYPE_COPYABLE);
+ Z_TYPE_FLAGS_P(zv) = 0;
}
return Z_STR_P(zv);
}
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 0beadace95..a574de9db6 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -441,7 +441,7 @@ static inline zend_string *zval_make_interned_string(zval *zv) /* {{{ */
ZEND_ASSERT(Z_TYPE_P(zv) == IS_STRING);
Z_STR_P(zv) = zend_new_interned_string(Z_STR_P(zv));
if (ZSTR_IS_INTERNED(Z_STR_P(zv))) {
- Z_TYPE_FLAGS_P(zv) &= ~ (IS_TYPE_REFCOUNTED | IS_TYPE_COPYABLE);
+ Z_TYPE_FLAGS_P(zv) = 0;
}
return Z_STR_P(zv);
}
diff --git a/ext/opcache/zend_persist.c b/ext/opcache/zend_persist.c
index e9aece79a1..136255dbef 100644
--- a/ext/opcache/zend_persist.c
+++ b/ext/opcache/zend_persist.c
@@ -283,7 +283,7 @@ static void zend_persist_zval(zval *z)
switch (Z_TYPE_P(z)) {
case IS_STRING:
zend_accel_store_interned_string(Z_STR_P(z));
- Z_TYPE_FLAGS_P(z) &= ~ (IS_TYPE_REFCOUNTED | IS_TYPE_COPYABLE);
+ Z_TYPE_FLAGS_P(z) = 0;
break;
case IS_ARRAY:
new_ptr = zend_shared_alloc_get_xlat_entry(Z_ARR_P(z));
@@ -319,12 +319,12 @@ static void zend_persist_zval(zval *z)
new_ptr = zend_shared_alloc_get_xlat_entry(Z_AST_P(z));
if (new_ptr) {
Z_AST_P(z) = new_ptr;
- Z_TYPE_FLAGS_P(z) &= ~ (IS_TYPE_REFCOUNTED | IS_TYPE_COPYABLE);
+ Z_TYPE_FLAGS_P(z) = 0;
} else {
zend_ast_ref *old_ref = Z_AST_P(z);
Z_ARR_P(z) = zend_accel_memdup(Z_AST_P(z), sizeof(zend_ast_ref));
zend_persist_ast(GC_AST(old_ref));
- Z_TYPE_FLAGS_P(z) &= ~ (IS_TYPE_REFCOUNTED | IS_TYPE_COPYABLE);
+ Z_TYPE_FLAGS_P(z) = 0;
GC_SET_REFCOUNT(Z_COUNTED_P(z), 2);
efree(old_ref);
}
diff --git a/ext/opcache/zend_persist_calc.c b/ext/opcache/zend_persist_calc.c
index a99a80077e..87ce9375eb 100644
--- a/ext/opcache/zend_persist_calc.c
+++ b/ext/opcache/zend_persist_calc.c
@@ -124,7 +124,7 @@ static void zend_persist_zval_calc(zval *z)
case IS_STRING:
ADD_INTERNED_STRING(Z_STR_P(z), 0);
if (ZSTR_IS_INTERNED(Z_STR_P(z))) {
- Z_TYPE_FLAGS_P(z) &= ~ (IS_TYPE_REFCOUNTED | IS_TYPE_COPYABLE);
+ Z_TYPE_FLAGS_P(z) = 0;
}
break;
case IS_ARRAY:
diff --git a/ext/standard/browscap.c b/ext/standard/browscap.c
index 32d377de3e..e58a20cd4d 100644
--- a/ext/standard/browscap.c
+++ b/ext/standard/browscap.c
@@ -330,7 +330,7 @@ static void php_browscap_parser_cb(zval *arg1, zval *arg2, zval *arg3, int callb
new_value = zend_new_interned_string(zend_string_copy(new_value));
if (ZSTR_IS_INTERNED(new_value)) {
if (new_value == Z_STR_P(arg2)) {
- Z_TYPE_FLAGS_P(arg2) &= ~(IS_TYPE_REFCOUNTED | IS_TYPE_COPYABLE);
+ Z_TYPE_FLAGS_P(arg2) = 0;
}
} else {
zend_string_release(new_value);
@@ -361,7 +361,7 @@ static void php_browscap_parser_cb(zval *arg1, zval *arg2, zval *arg3, int callb
new_key = zend_new_interned_string(zend_string_copy(new_key));
if (ZSTR_IS_INTERNED(new_key)) {
if (new_key == Z_STR_P(arg1)) {
- Z_TYPE_FLAGS_P(arg1) &= ~(IS_TYPE_REFCOUNTED | IS_TYPE_COPYABLE);
+ Z_TYPE_FLAGS_P(arg1) = 0;
}
} else {
zend_string_release(new_key);
@@ -389,7 +389,7 @@ static void php_browscap_parser_cb(zval *arg1, zval *arg2, zval *arg3, int callb
if (persistent) {
pattern = zend_new_interned_string(zend_string_copy(pattern));
if (ZSTR_IS_INTERNED(pattern)) {
- Z_TYPE_FLAGS_P(arg1) &= ~(IS_TYPE_REFCOUNTED | IS_TYPE_COPYABLE);
+ Z_TYPE_FLAGS_P(arg1) = 0;
} else {
zend_string_release(pattern);
}