@@ -2596,6 +2596,11 @@ static zend_ffi_type* accel_ffi_persist_type_copy(void** ptr, zend_ffi_type *typ
2596
2596
break ;
2597
2597
case ZEND_FFI_TYPE_STRUCT :
2598
2598
ht = & new_type -> record .fields ;
2599
+ GC_SET_REFCOUNT (ht , 2 );
2600
+ GC_ADD_FLAGS (ht , IS_ARRAY_IMMUTABLE );
2601
+ HT_FLAGS (ht ) |= HASH_FLAG_STATIC_KEYS ;
2602
+ ht -> pDestructor = NULL ;
2603
+ ht -> nInternalPointer = 0 ;
2599
2604
if (HT_IS_PACKED (ht )) {
2600
2605
memcpy (* ptr , ht -> arPacked , HT_PACKED_USED_SIZE (ht ));
2601
2606
ht -> arPacked = (zval * )(* ptr );
@@ -2622,6 +2627,11 @@ static zend_ffi_type* accel_ffi_persist_type_copy(void** ptr, zend_ffi_type *typ
2622
2627
memcpy (ht , new_type -> func .args , sizeof (HashTable ));
2623
2628
(* ptr ) = (void * )((char * )(* ptr ) + sizeof (HashTable ));
2624
2629
new_type -> func .args = ht ;
2630
+ GC_SET_REFCOUNT (ht , 2 );
2631
+ GC_ADD_FLAGS (ht , IS_ARRAY_IMMUTABLE );
2632
+ HT_FLAGS (ht ) |= HASH_FLAG_STATIC_KEYS ;
2633
+ ht -> pDestructor = NULL ;
2634
+ ht -> nInternalPointer = 0 ;
2625
2635
ZEND_ASSERT (HT_IS_PACKED (ht ));
2626
2636
memcpy (* ptr , ht -> arPacked , HT_PACKED_USED_SIZE (ht ));
2627
2637
ht -> arPacked = (zval * )(* ptr );
0 commit comments