mirror of
https://github.com/php/php-src.git
synced 2025-08-16 14:08:47 +02:00
properties_info_table may be in arena or shm
For immutable classes it should be shm instead of in arena. Related to bug #77615.
This commit is contained in:
parent
c62e106610
commit
ffc7e953ea
3 changed files with 12 additions and 4 deletions
|
@ -37,3 +37,7 @@ trait T2 {
|
|||
class Y {
|
||||
use T2;
|
||||
}
|
||||
|
||||
class Z {
|
||||
public $foo;
|
||||
}
|
||||
|
|
|
@ -874,9 +874,13 @@ static void zend_persist_class_entry(zval *zv)
|
|||
int i;
|
||||
|
||||
size_t size = sizeof(zend_property_info *) * ce->default_properties_count;
|
||||
memcpy(ZCG(arena_mem), ce->properties_info_table, size);
|
||||
ce->properties_info_table = ZCG(arena_mem);
|
||||
ZCG(arena_mem) = (void*)((char*)ZCG(arena_mem) + ZEND_ALIGNED_SIZE(size));
|
||||
if (ZCG(is_immutable_class)) {
|
||||
ce->properties_info_table = zend_shared_memdup_put(
|
||||
ce->properties_info_table, size);
|
||||
} else {
|
||||
ce->properties_info_table = zend_shared_memdup_arena_put(
|
||||
ce->properties_info_table, size);
|
||||
}
|
||||
|
||||
for (i = 0; i < ce->default_properties_count; i++) {
|
||||
ce->properties_info_table[i] = zend_shared_alloc_get_xlat_entry(ce->properties_info_table[i]);
|
||||
|
|
|
@ -388,7 +388,7 @@ static void zend_persist_class_entry_calc(zval *zv)
|
|||
zend_hash_persist_calc(&ce->properties_info, zend_persist_property_info_calc);
|
||||
|
||||
if (ce->properties_info_table) {
|
||||
ADD_ARENA_SIZE(sizeof(zend_property_info *) * ce->default_properties_count);
|
||||
ADD_SIZE_EX(sizeof(zend_property_info *) * ce->default_properties_count);
|
||||
}
|
||||
|
||||
if (ce->num_interfaces) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue