@@ -1746,15 +1746,10 @@ ZEND_API inheritance_status zend_verify_property_hook_variance(const zend_proper
1746
1746
return zend_perform_covariant_type_check (ce , prop_info -> type , ce , value_arg_info -> type );
1747
1747
}
1748
1748
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. */
1758
1753
static void zend_link_hooked_object_iter (zend_class_entry * ce ) {
1759
1754
if (!ce -> get_iterator && ce -> num_hooked_props ) {
1760
1755
ce -> get_iterator = zend_hooked_object_get_iterator ;
@@ -3431,7 +3426,7 @@ static zend_class_entry *zend_lazy_class_load(zend_class_entry *pce)
3431
3426
return ce ;
3432
3427
}
3433
3428
3434
- #ifndef ZEND_WIN32
3429
+ #ifndef ZEND_OPCACHE_SHM_REATTACHMENT
3435
3430
# define UPDATE_IS_CACHEABLE (ce ) do { \
3436
3431
if ((ce)->type == ZEND_USER_CLASS) { \
3437
3432
is_cacheable &= (ce)->ce_flags; \
@@ -3576,7 +3571,7 @@ ZEND_API zend_class_entry *zend_do_link_class(zend_class_entry *ce, zend_string
3576
3571
zend_enum_register_funcs (ce );
3577
3572
}
3578
3573
3579
- #ifdef ZEND_WIN32
3574
+ #ifdef ZEND_OPCACHE_SHM_REATTACHMENT
3580
3575
zend_link_hooked_object_iter (ce );
3581
3576
#endif
3582
3577
@@ -3868,7 +3863,7 @@ ZEND_API zend_class_entry *zend_try_early_bind(zend_class_entry *ce, zend_class_
3868
3863
zend_begin_record_errors ();
3869
3864
}
3870
3865
3871
- #ifdef ZEND_WIN32
3866
+ #ifdef ZEND_OPCACHE_SHM_REATTACHMENT
3872
3867
zend_link_hooked_object_iter (ce );
3873
3868
#endif
3874
3869
0 commit comments