1
0
mirror of https://github.com/php/php-src.git synced 2026-04-16 20:41:18 +02:00

Use GC_FLAGS_SHIFT in a few more places

Rather than hardcoding 8.
This commit is contained in:
Nikita Popov
2017-12-30 17:54:57 +01:00
parent ba85001439
commit b6581038eb
4 changed files with 5 additions and 5 deletions

View File

@@ -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);

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;
}
}