From: Dmitry Stogov Date: Fri, 27 Oct 2017 11:42:06 +0000 (+0300) Subject: Makrk persistent resources and references with GC_PERSISTENT flag X-Git-Tag: php-7.3.0alpha1~1160^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0136ecb69a67bc872a6e9c6beb3c1900169a53f0;p=php Makrk persistent resources and references with GC_PERSISTENT flag --- diff --git a/Zend/zend_types.h b/Zend/zend_types.h index 4f073d4719..159fc0f81d 100644 --- a/Zend/zend_types.h +++ b/Zend/zend_types.h @@ -766,7 +766,8 @@ static zend_always_inline zend_uchar zval_get_type(const zval* pz) { (zend_resource *) malloc(sizeof(zend_resource)); \ zval *__z; \ GC_REFCOUNT(_res) = 1; \ - GC_TYPE_INFO(_res) = IS_RESOURCE; \ + GC_TYPE_INFO(_res) = IS_RESOURCE | \ + (GC_PERSISTENT << GC_FLAGS_SHIFT); \ _res->handle = (h); \ _res->type = (t); \ _res->ptr = (p); \ @@ -804,7 +805,8 @@ static zend_always_inline zend_uchar zval_get_type(const zval* pz) { zend_reference *_ref = \ (zend_reference *) malloc(sizeof(zend_reference)); \ GC_REFCOUNT(_ref) = 1; \ - GC_TYPE_INFO(_ref) = IS_REFERENCE; \ + GC_TYPE_INFO(_ref) = IS_REFERENCE | \ + (GC_PERSISTENT << GC_FLAGS_SHIFT); \ ZVAL_COPY_VALUE(&_ref->val, r); \ Z_REF_P(z) = _ref; \ Z_TYPE_INFO_P(z) = IS_REFERENCE_EX; \