com php-src: Use GC_FLAGS_SHIFT in a few more pla ces: Zend/zend_string.h ext/opcache/ZendAccelerator .c ext/opcache/zend_file_cache.c
ext/opcache/zend _persist.c
| From: | Nikita Popov | Date: | Sat, 30 Dec 2017 22:40:25 +0000 |
| Subject: | com php-src: Use GC_FLAGS_SHIFT in a few more pla ces: Zend/zend_string.h ext/opcache/ZendAccelerator .c ext/opcache/zend_file_cache.c ext/opcache/zend _persist.c |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-100721@lists.php.net to get a copy of this message | ||
Commit: b6581038eb1bf8a930149ff45242dedc5d6908ad
Author: Nikita Popov <nikita.ppv@gmail.com> Sat, 30 Dec 2017 17:54:57 +0100
Parents: ba85001439694b54d620166ec8244839477ab0a4
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=b6581038eb1bf8a930149ff45242dedc5d6908ad
Log:
Use GC_FLAGS_SHIFT in a few more places
Rather than hardcoding 8.
Changed paths:
M Zend/zend_string.h
M ext/opcache/ZendAccelerator.c
M ext/opcache/zend_file_cache.c
M ext/opcache/zend_persist.c
Diff:
diff --git a/Zend/zend_string.h b/Zend/zend_string.h
index 2bbcdb8..fc6321d 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 a06bc00..b99927c 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 0378351..16f59b6 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 a6792aa..7e916b1 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;
}
}