summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2017-12-30 17:54:57 +0100
committerNikita Popov <nikita.ppv@gmail.com>2017-12-30 23:40:25 +0100
commitb6581038eb1bf8a930149ff45242dedc5d6908ad (patch)
treec68ff9620bb2db31df0b44987fa2715a9d6416f7
parentba85001439694b54d620166ec8244839477ab0a4 (diff)
downloadphp-git-b6581038eb1bf8a930149ff45242dedc5d6908ad.tar.gz
Use GC_FLAGS_SHIFT in a few more places
Rather than hardcoding 8.
-rw-r--r--Zend/zend_string.h4
-rw-r--r--ext/opcache/ZendAccelerator.c2
-rw-r--r--ext/opcache/zend_file_cache.c2
-rw-r--r--ext/opcache/zend_persist.c2
4 files changed, 5 insertions, 5 deletions
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;
}
}