@@ -81,10 +81,10 @@ static zend_function *zend_duplicate_internal_function(zend_function *func, zend
81
81
82
82
if (UNEXPECTED (ce -> type & ZEND_INTERNAL_CLASS )) {
83
83
new_function = pemalloc (sizeof (zend_internal_function ), 1 );
84
- memcpy (new_function , func , sizeof (zend_internal_function ));
84
+ ZEND_MEMCPY_INLINE (new_function , func , sizeof (zend_internal_function ));
85
85
} else {
86
86
new_function = zend_arena_alloc (& CG (arena ), sizeof (zend_internal_function ));
87
- memcpy (new_function , func , sizeof (zend_internal_function ));
87
+ ZEND_MEMCPY_INLINE (new_function , func , sizeof (zend_internal_function ));
88
88
new_function -> common .fn_flags |= ZEND_ACC_ARENA_ALLOCATED ;
89
89
}
90
90
if (EXPECTED (new_function -> common .function_name )) {
@@ -1111,7 +1111,7 @@ static zend_always_inline inheritance_status do_inheritance_check_on_method_ex(
1111
1111
} else {
1112
1112
/* op_array wasn't duplicated yet */
1113
1113
zend_function * new_function = zend_arena_alloc (& CG (arena ), sizeof (zend_op_array ));
1114
- memcpy (new_function , child , sizeof (zend_op_array ));
1114
+ ZEND_MEMCPY_INLINE (new_function , child , sizeof (zend_op_array ));
1115
1115
Z_PTR_P (child_zv ) = child = new_function ;
1116
1116
}
1117
1117
}
@@ -1352,13 +1352,13 @@ static void do_inherit_class_constant(zend_string *name, zend_class_constant *pa
1352
1352
ce -> ce_flags |= ZEND_ACC_HAS_AST_CONSTANTS ;
1353
1353
if (ce -> parent -> ce_flags & ZEND_ACC_IMMUTABLE ) {
1354
1354
c = zend_arena_alloc (& CG (arena ), sizeof (zend_class_constant ));
1355
- memcpy (c , parent_const , sizeof (zend_class_constant ));
1355
+ ZEND_MEMCPY_INLINE (c , parent_const , sizeof (zend_class_constant ));
1356
1356
parent_const = c ;
1357
1357
}
1358
1358
}
1359
1359
if (ce -> type & ZEND_INTERNAL_CLASS ) {
1360
1360
c = pemalloc (sizeof (zend_class_constant ), 1 );
1361
- memcpy (c , parent_const , sizeof (zend_class_constant ));
1361
+ ZEND_MEMCPY_INLINE (c , parent_const , sizeof (zend_class_constant ));
1362
1362
parent_const = c ;
1363
1363
}
1364
1364
_zend_hash_append_ptr (& ce -> constants_table , name , parent_const );
@@ -1638,14 +1638,14 @@ static void do_inherit_iface_constant(zend_string *name, zend_class_constant *c,
1638
1638
ce -> ce_flags |= ZEND_ACC_HAS_AST_CONSTANTS ;
1639
1639
if (iface -> ce_flags & ZEND_ACC_IMMUTABLE ) {
1640
1640
ct = zend_arena_alloc (& CG (arena ), sizeof (zend_class_constant ));
1641
- memcpy (ct , c , sizeof (zend_class_constant ));
1641
+ ZEND_MEMCPY_INLINE (ct , c , sizeof (zend_class_constant ));
1642
1642
c = ct ;
1643
1643
Z_CONSTANT_FLAGS (c -> value ) |= CONST_OWNED ;
1644
1644
}
1645
1645
}
1646
1646
if (ce -> type & ZEND_INTERNAL_CLASS ) {
1647
1647
ct = pemalloc (sizeof (zend_class_constant ), 1 );
1648
- memcpy (ct , c , sizeof (zend_class_constant ));
1648
+ ZEND_MEMCPY_INLINE (ct , c , sizeof (zend_class_constant ));
1649
1649
c = ct ;
1650
1650
}
1651
1651
zend_hash_update_ptr (& ce -> constants_table , name , c );
@@ -1837,11 +1837,11 @@ static void zend_add_trait_method(zend_class_entry *ce, zend_string *name, zend_
1837
1837
1838
1838
if (UNEXPECTED (fn -> type == ZEND_INTERNAL_FUNCTION )) {
1839
1839
new_fn = zend_arena_alloc (& CG (arena ), sizeof (zend_internal_function ));
1840
- memcpy (new_fn , fn , sizeof (zend_internal_function ));
1840
+ ZEND_MEMCPY_INLINE (new_fn , fn , sizeof (zend_internal_function ));
1841
1841
new_fn -> common .fn_flags |= ZEND_ACC_ARENA_ALLOCATED ;
1842
1842
} else {
1843
1843
new_fn = zend_arena_alloc (& CG (arena ), sizeof (zend_op_array ));
1844
- memcpy (new_fn , fn , sizeof (zend_op_array ));
1844
+ ZEND_MEMCPY_INLINE (new_fn , fn , sizeof (zend_op_array ));
1845
1845
new_fn -> op_array .fn_flags |= ZEND_ACC_TRAIT_CLONE ;
1846
1846
new_fn -> op_array .fn_flags &= ~ZEND_ACC_IMMUTABLE ;
1847
1847
}
@@ -2425,14 +2425,14 @@ static void add_compatibility_obligation(
2425
2425
obligation -> type = OBLIGATION_COMPATIBILITY ;
2426
2426
/* Copy functions, because they may be stack-allocated in the case of traits. */
2427
2427
if (child_fn -> common .type == ZEND_INTERNAL_FUNCTION ) {
2428
- memcpy (& obligation -> child_fn , child_fn , sizeof (zend_internal_function ));
2428
+ ZEND_MEMCPY_INLINE (& obligation -> child_fn , child_fn , sizeof (zend_internal_function ));
2429
2429
} else {
2430
- memcpy (& obligation -> child_fn , child_fn , sizeof (zend_op_array ));
2430
+ ZEND_MEMCPY_INLINE (& obligation -> child_fn , child_fn , sizeof (zend_op_array ));
2431
2431
}
2432
2432
if (parent_fn -> common .type == ZEND_INTERNAL_FUNCTION ) {
2433
- memcpy (& obligation -> parent_fn , parent_fn , sizeof (zend_internal_function ));
2433
+ ZEND_MEMCPY_INLINE (& obligation -> parent_fn , parent_fn , sizeof (zend_internal_function ));
2434
2434
} else {
2435
- memcpy (& obligation -> parent_fn , parent_fn , sizeof (zend_op_array ));
2435
+ ZEND_MEMCPY_INLINE (& obligation -> parent_fn , parent_fn , sizeof (zend_op_array ));
2436
2436
}
2437
2437
obligation -> child_scope = child_scope ;
2438
2438
obligation -> parent_scope = parent_scope ;
@@ -2553,7 +2553,7 @@ static zend_class_entry *zend_lazy_class_load(zend_class_entry *pce)
2553
2553
Bucket * p , * end ;
2554
2554
2555
2555
ce = zend_arena_alloc (& CG (arena ), sizeof (zend_class_entry ));
2556
- memcpy (ce , pce , sizeof (zend_class_entry ));
2556
+ ZEND_MEMCPY_INLINE (ce , pce , sizeof (zend_class_entry ));
2557
2557
ce -> ce_flags &= ~ZEND_ACC_IMMUTABLE ;
2558
2558
ce -> refcount = 1 ;
2559
2559
ce -> inheritance_cache = NULL ;
@@ -2592,7 +2592,7 @@ static zend_class_entry *zend_lazy_class_load(zend_class_entry *pce)
2592
2592
ZEND_ASSERT (op_array -> prototype == NULL );
2593
2593
new_op_array = zend_arena_alloc (& CG (arena ), sizeof (zend_op_array ));
2594
2594
Z_PTR (p -> val ) = new_op_array ;
2595
- memcpy (new_op_array , op_array , sizeof (zend_op_array ));
2595
+ ZEND_MEMCPY_INLINE (new_op_array , op_array , sizeof (zend_op_array ));
2596
2596
new_op_array -> fn_flags &= ~ZEND_ACC_IMMUTABLE ;
2597
2597
new_op_array -> scope = ce ;
2598
2598
ZEND_MAP_PTR_INIT (new_op_array -> run_time_cache , NULL );
@@ -2641,7 +2641,7 @@ static zend_class_entry *zend_lazy_class_load(zend_class_entry *pce)
2641
2641
ZEND_ASSERT (prop_info -> ce == pce );
2642
2642
new_prop_info = zend_arena_alloc (& CG (arena ), sizeof (zend_property_info ));
2643
2643
Z_PTR (p -> val ) = new_prop_info ;
2644
- memcpy (new_prop_info , prop_info , sizeof (zend_property_info ));
2644
+ ZEND_MEMCPY_INLINE (new_prop_info , prop_info , sizeof (zend_property_info ));
2645
2645
new_prop_info -> ce = ce ;
2646
2646
if (ZEND_TYPE_HAS_LIST (new_prop_info -> type )) {
2647
2647
zend_type_list * new_list ;
@@ -2669,7 +2669,7 @@ static zend_class_entry *zend_lazy_class_load(zend_class_entry *pce)
2669
2669
ZEND_ASSERT (c -> ce == pce );
2670
2670
new_c = zend_arena_alloc (& CG (arena ), sizeof (zend_class_constant ));
2671
2671
Z_PTR (p -> val ) = new_c ;
2672
- memcpy (new_c , c , sizeof (zend_class_constant ));
2672
+ ZEND_MEMCPY_INLINE (new_c , c , sizeof (zend_class_constant ));
2673
2673
new_c -> ce = ce ;
2674
2674
}
2675
2675
}
0 commit comments