Skip to content

Commit 0af2a9f

Browse files
committed
avoid re-alloc due to packed..mixed conversion
1 parent 2ccb314 commit 0af2a9f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

msgpack_unpack.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -735,6 +735,10 @@ int msgpack_unserialize_map_item(msgpack_unserialize_data *unpack, zval **contai
735735
} else {
736736
if (Z_TYPE_P(container_val) != IS_ARRAY) {
737737
array_init_size(container_val, MIN(unpack->count, 1<<16));
738+
#if PHP_VERSION_ID >= 70300
739+
/* avoid re-alloc due packed..mixed conversion */
740+
zend_hash_real_init_mixed(Z_ARRVAL_P(container_val));
741+
#endif
738742
}
739743
switch (Z_TYPE_P(key)) {
740744
case IS_LONG:

0 commit comments

Comments
 (0)