@@ -1746,15 +1746,10 @@ ZEND_API inheritance_status zend_verify_property_hook_variance(const zend_proper
17461746 return zend_perform_covariant_type_check (ce , prop_info -> type , ce , value_arg_info -> type );
17471747}
17481748
1749- #ifdef ZEND_WIN32
1750- /* Hooked properties set get_iterator, which causes issues on Windows. Windows
1751- * attaches multiple processes to the same shm, with each process potentially
1752- * having different addresses to the corresponding get_iterator function due to
1753- * ASLR. This prevents us from caching the class.
1754- *
1755- * To at least cache the unlinked class, avoid early-binding on Windows, and set
1756- * get_iterator during inheritance. The linked class may not use inheritance
1757- * cache. */
1749+ #ifdef ZEND_OPCACHE_SHM_REATTACHMENT
1750+ /* Hooked properties set get_iterator, which causes issues on for shm
1751+ * reattachment. Avoid early-binding on Windows and set get_iterator during
1752+ * inheritance. The linked class may not use inheritance cache. */
17581753static void zend_link_hooked_object_iter (zend_class_entry * ce ) {
17591754 if (!ce -> get_iterator && ce -> num_hooked_props ) {
17601755 ce -> get_iterator = zend_hooked_object_get_iterator ;
@@ -3431,7 +3426,7 @@ static zend_class_entry *zend_lazy_class_load(zend_class_entry *pce)
34313426 return ce ;
34323427}
34333428
3434- #ifndef ZEND_WIN32
3429+ #ifndef ZEND_OPCACHE_SHM_REATTACHMENT
34353430# define UPDATE_IS_CACHEABLE (ce ) do { \
34363431 if ((ce)->type == ZEND_USER_CLASS) { \
34373432 is_cacheable &= (ce)->ce_flags; \
@@ -3576,7 +3571,7 @@ ZEND_API zend_class_entry *zend_do_link_class(zend_class_entry *ce, zend_string
35763571 zend_enum_register_funcs (ce );
35773572 }
35783573
3579- #ifdef ZEND_WIN32
3574+ #ifdef ZEND_OPCACHE_SHM_REATTACHMENT
35803575 zend_link_hooked_object_iter (ce );
35813576#endif
35823577
@@ -3868,7 +3863,7 @@ ZEND_API zend_class_entry *zend_try_early_bind(zend_class_entry *ce, zend_class_
38683863 zend_begin_record_errors ();
38693864 }
38703865
3871- #ifdef ZEND_WIN32
3866+ #ifdef ZEND_OPCACHE_SHM_REATTACHMENT
38723867 zend_link_hooked_object_iter (ce );
38733868#endif
38743869
0 commit comments