From: Dmitry Stogov Date: Fri, 27 Oct 2017 11:59:09 +0000 (+0300) Subject: Merge branch 'master' into rc_debug X-Git-Tag: php-7.3.0alpha1~1160 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8203a0668d1ec4d667336f8f3be469873d740911;p=php Merge branch 'master' into rc_debug * master: Use per-request heap instead of system one Extend zend_register_class_alias_ex() with additional argument to allow creating persistent or per-request aliases Makrk persistent resources and references with GC_PERSISTENT flag --- 8203a0668d1ec4d667336f8f3be469873d740911 diff --cc Zend/zend_types.h index 56217d579e,159fc0f81d..9b9c578e20 --- a/Zend/zend_types.h +++ b/Zend/zend_types.h @@@ -771,8 -765,9 +771,9 @@@ static zend_always_inline zend_uchar zv zend_resource *_res = \ (zend_resource *) malloc(sizeof(zend_resource)); \ zval *__z; \ - GC_REFCOUNT(_res) = 1; \ + GC_SET_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); \ @@@ -809,8 -804,9 +810,9 @@@ #define ZVAL_NEW_PERSISTENT_REF(z, r) do { \ zend_reference *_ref = \ (zend_reference *) malloc(sizeof(zend_reference)); \ - GC_REFCOUNT(_ref) = 1; \ + GC_SET_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; \