Add comment for specialization in zend_hash_real_init_packed_ex()

As the seemingly reundant code may be confusing. Closes GH-6988.
This commit is contained in:
Nikita Popov 2021-05-26 11:51:44 +02:00
parent a40cdd55f8
commit 07da2e3f28

View File

@ -150,6 +150,7 @@ static zend_always_inline void zend_hash_real_init_packed_ex(HashTable *ht)
if (UNEXPECTED(GC_FLAGS(ht) & IS_ARRAY_PERSISTENT)) {
data = pemalloc(HT_SIZE_EX(ht->nTableSize, HT_MIN_MASK), 1);
} else if (EXPECTED(ht->nTableSize == HT_MIN_SIZE)) {
/* Use specialized API with constant allocation amount for a particularly common case. */
data = emalloc(HT_SIZE_EX(HT_MIN_SIZE, HT_MIN_MASK));
} else {
data = emalloc(HT_SIZE_EX(ht->nTableSize, HT_MIN_MASK));