Skip to content

Commit 07da2e3

Browse files
committed
Add comment for specialization in zend_hash_real_init_packed_ex()
As the seemingly reundant code may be confusing. Closes GH-6988.
1 parent a40cdd5 commit 07da2e3

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Zend/zend_hash.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ static zend_always_inline void zend_hash_real_init_packed_ex(HashTable *ht)
150150
if (UNEXPECTED(GC_FLAGS(ht) & IS_ARRAY_PERSISTENT)) {
151151
data = pemalloc(HT_SIZE_EX(ht->nTableSize, HT_MIN_MASK), 1);
152152
} else if (EXPECTED(ht->nTableSize == HT_MIN_SIZE)) {
153+
/* Use specialized API with constant allocation amount for a particularly common case. */
153154
data = emalloc(HT_SIZE_EX(HT_MIN_SIZE, HT_MIN_MASK));
154155
} else {
155156
data = emalloc(HT_SIZE_EX(ht->nTableSize, HT_MIN_MASK));

0 commit comments

Comments
 (0)