From: Nikita Popov Date: Sat, 30 Dec 2017 16:54:57 +0000 (+0100) Subject: Use GC_FLAGS_SHIFT in a few more places X-Git-Tag: php-7.3.0alpha1~720 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b6581038eb1bf8a930149ff45242dedc5d6908ad;p=php Use GC_FLAGS_SHIFT in a few more places Rather than hardcoding 8. --- diff --git a/Zend/zend_string.h b/Zend/zend_string.h index 2bbcdb80a8..fc6321d965 100644 --- a/Zend/zend_string.h +++ b/Zend/zend_string.h @@ -138,7 +138,7 @@ static zend_always_inline zend_string *zend_string_alloc(size_t len, int persist GC_SET_REFCOUNT(ret, 1); #if 1 /* optimized single assignment */ - GC_TYPE_INFO(ret) = IS_STRING | ((persistent ? IS_STR_PERSISTENT : 0) << 8); + GC_TYPE_INFO(ret) = IS_STRING | ((persistent ? IS_STR_PERSISTENT : 0) << GC_FLAGS_SHIFT); #else GC_TYPE(ret) = IS_STRING; GC_FLAGS(ret) = (persistent ? IS_STR_PERSISTENT : 0); @@ -156,7 +156,7 @@ static zend_always_inline zend_string *zend_string_safe_alloc(size_t n, size_t m GC_SET_REFCOUNT(ret, 1); #if 1 /* optimized single assignment */ - GC_TYPE_INFO(ret) = IS_STRING | ((persistent ? IS_STR_PERSISTENT : 0) << 8); + GC_TYPE_INFO(ret) = IS_STRING | ((persistent ? IS_STR_PERSISTENT : 0) << GC_FLAGS_SHIFT); #else GC_TYPE(ret) = IS_STRING; GC_FLAGS(ret) = (persistent ? IS_STR_PERSISTENT : 0); diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index a06bc00070..b99927cbf2 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -482,7 +482,7 @@ zend_string *accel_new_interned_string(zend_string *str) GC_SET_REFCOUNT(s, 1); #if 1 /* optimized single assignment */ - GC_TYPE_INFO(s) = IS_STRING | ((IS_STR_INTERNED | IS_STR_PERMANENT) << 8); + GC_TYPE_INFO(s) = IS_STRING | ((IS_STR_INTERNED | IS_STR_PERMANENT) << GC_FLAGS_SHIFT); #else GC_TYPE(s) = IS_STRING; GC_FLAGS(s) = IS_STR_INTERNED | IS_STR_PERMANENT; diff --git a/ext/opcache/zend_file_cache.c b/ext/opcache/zend_file_cache.c index 0378351120..16f59b6eaa 100644 --- a/ext/opcache/zend_file_cache.c +++ b/ext/opcache/zend_file_cache.c @@ -237,7 +237,7 @@ static void *zend_file_cache_unserialize_interned(zend_string *str, int in_shm) memcpy(ret, str, size); /* String wasn't interned but we will use it as interned anyway */ GC_SET_REFCOUNT(ret, 1); - GC_TYPE_INFO(ret) = IS_STRING | ((IS_STR_INTERNED | IS_STR_PERSISTENT | IS_STR_PERMANENT) << 8); + GC_TYPE_INFO(ret) = IS_STRING | ((IS_STR_INTERNED | IS_STR_PERSISTENT | IS_STR_PERMANENT) << GC_FLAGS_SHIFT); } } else { ret = str; diff --git a/ext/opcache/zend_persist.c b/ext/opcache/zend_persist.c index a6792aa1ff..7e916b12c1 100644 --- a/ext/opcache/zend_persist.c +++ b/ext/opcache/zend_persist.c @@ -371,7 +371,7 @@ static void zend_persist_op_array_ex(zend_op_array *op_array, zend_persistent_sc zend_accel_store(op_array->static_variables, sizeof(HashTable)); /* make immutable array */ GC_SET_REFCOUNT(op_array->static_variables, 2); - GC_TYPE_INFO(op_array->static_variables) = IS_ARRAY | (IS_ARRAY_IMMUTABLE << 8); + GC_TYPE_INFO(op_array->static_variables) = IS_ARRAY | (IS_ARRAY_IMMUTABLE << GC_FLAGS_SHIFT); op_array->static_variables->u.flags |= HASH_FLAG_STATIC_KEYS; } }