@@ -211,10 +211,10 @@ static zend_always_inline Bucket *simdjson_hash_str_find_bucket(const HashTable
211
211
return NULL ;
212
212
}
213
213
214
- static zend_always_inline void simdjson_release_reused_key_strings (HashTable *dedup_key_strings ) {
215
- ZEND_ASSERT (dedup_key_strings ->nNumUsed > 0 );
216
- Bucket *p = dedup_key_strings ->arData ;
217
- Bucket *end = p + dedup_key_strings ->nNumUsed ;
214
+ static zend_always_inline void simdjson_dedup_key_strings_release (HashTable *ht ) {
215
+ ZEND_ASSERT (ht ->nNumUsed > 0 );
216
+ Bucket *p = ht ->arData ;
217
+ Bucket *end = p + ht ->nNumUsed ;
218
218
do {
219
219
if (GC_DELREF (p->key ) == 0 ) {
220
220
ZEND_ASSERT (!(GC_FLAGS (p->key ) & IS_STR_PERSISTENT));
@@ -223,7 +223,7 @@ static zend_always_inline void simdjson_release_reused_key_strings(HashTable *de
223
223
} while (++p != end);
224
224
}
225
225
226
- static zend_always_inline void simdjson_init_reused_key_strings (HashTable *ht) {
226
+ static zend_always_inline void simdjson_dedup_key_strings_init (HashTable *ht) {
227
227
if (UNEXPECTED (ht->nTableSize == 0 )) {
228
228
// zend_hash_init
229
229
ht->nNumUsed = 0 ;
@@ -236,7 +236,7 @@ static zend_always_inline void simdjson_init_reused_key_strings(HashTable *ht) {
236
236
} else if (ht->nNumUsed > SIMDJSON_DEDUP_STRING_COUNT / 2 ) {
237
237
// more than half of hash table is already full before decoding new structure, so we will make space for new keys
238
238
// by removing old keys
239
- simdjson_release_reused_key_strings (ht);
239
+ simdjson_dedup_key_strings_release (ht);
240
240
ZEND_ASSERT (ht->nTableMask == HT_SIZE_TO_MASK (SIMDJSON_DEDUP_STRING_COUNT));
241
241
HT_HASH_RESET (ht);
242
242
ht->nNumUsed = 0 ;
@@ -547,7 +547,7 @@ PHP_SIMDJSON_API void php_simdjson_free_parser(simdjson_php_parser* parser) /* {
547
547
// Destroy dedup_key_strings hash if was allocated
548
548
if (parser->dedup_key_strings .nTableSize ) {
549
549
if (parser->dedup_key_strings .nNumUsed ) {
550
- simdjson_release_reused_key_strings (&parser->dedup_key_strings );
550
+ simdjson_dedup_key_strings_release (&parser->dedup_key_strings );
551
551
}
552
552
efree (HT_GET_DATA_ADDR (&parser->dedup_key_strings ));
553
553
}
@@ -558,7 +558,7 @@ PHP_SIMDJSON_API void php_simdjson_free_parser(simdjson_php_parser* parser) /* {
558
558
static simdjson_php_error_code simdjson_convert_element (simdjson::dom::element element, zval *return_value, bool associative, HashTable *dedup_key_strings) {
559
559
#if PHP_VERSION_ID >= 80200
560
560
// Allocate table for reusing already allocated keys
561
- simdjson_init_reused_key_strings (dedup_key_strings);
561
+ simdjson_dedup_key_strings_init (dedup_key_strings);
562
562
#endif
563
563
simdjson_php_error_code resp;
564
564
if (associative) {
0 commit comments