Lines Matching refs:nSize

95 static uint32_t zend_always_inline zend_hash_check_size(uint32_t nSize)  in zend_hash_check_size()  argument
103 if (nSize < HT_MIN_SIZE) { in zend_hash_check_size()
104 nSize = HT_MIN_SIZE; in zend_hash_check_size()
105 } else if (UNEXPECTED(nSize >= HT_MAX_SIZE)) { in zend_hash_check_size()
106 …RROR, "Possible integer overflow in memory allocation (%zu * %zu + %zu)", nSize, sizeof(Bucket), s… in zend_hash_check_size()
110 if (BitScanReverse(&index, nSize - 1)) { in zend_hash_check_size()
115 return nSize; in zend_hash_check_size()
118 return 0x2 << (__builtin_clz(nSize - 1) ^ 0x1f); in zend_hash_check_size()
120 nSize -= 1; in zend_hash_check_size()
121 nSize |= (nSize >> 1); in zend_hash_check_size()
122 nSize |= (nSize >> 2); in zend_hash_check_size()
123 nSize |= (nSize >> 4); in zend_hash_check_size()
124 nSize |= (nSize >> 8); in zend_hash_check_size()
125 nSize |= (nSize >> 16); in zend_hash_check_size()
126 return nSize + 1; in zend_hash_check_size()
173 ZEND_API void ZEND_FASTCALL _zend_hash_init(HashTable *ht, uint32_t nSize, dtor_func_t pDestructor,… in _zend_hash_init() argument
185 ht->nTableSize = zend_hash_check_size(nSize); in _zend_hash_init()
242 ZEND_API void ZEND_FASTCALL _zend_hash_init_ex(HashTable *ht, uint32_t nSize, dtor_func_t pDestruct… in _zend_hash_init_ex() argument
244 _zend_hash_init(ht, nSize, pDestructor, persistent ZEND_FILE_LINE_RELAY_CC); in _zend_hash_init_ex()
250 ZEND_API void ZEND_FASTCALL zend_hash_extend(HashTable *ht, uint32_t nSize, zend_bool packed) in zend_hash_extend() argument
253 if (nSize == 0) return; in zend_hash_extend()
255 if (nSize > ht->nTableSize) { in zend_hash_extend()
256 ht->nTableSize = zend_hash_check_size(nSize); in zend_hash_extend()
262 if (nSize > ht->nTableSize) { in zend_hash_extend()
264 ht->nTableSize = zend_hash_check_size(nSize); in zend_hash_extend()
270 if (nSize > ht->nTableSize) { in zend_hash_extend()
273 nSize = zend_hash_check_size(nSize); in zend_hash_extend()
275 new_data = pemalloc(HT_SIZE_EX(nSize, -nSize), ht->u.flags & HASH_FLAG_PERSISTENT); in zend_hash_extend()
276 ht->nTableSize = nSize; in zend_hash_extend()
883 uint32_t nSize = ht->nTableSize + ht->nTableSize; in zend_hash_do_resize() local
887 new_data = pemalloc(HT_SIZE_EX(nSize, -nSize), ht->u.flags & HASH_FLAG_PERSISTENT); in zend_hash_do_resize()
888 ht->nTableSize = nSize; in zend_hash_do_resize()