Lines Matching refs:accel_hash
32 void zend_accel_hash_clean(zend_accel_hash *accel_hash) in zend_accel_hash_clean() argument
34 accel_hash->num_entries = 0; in zend_accel_hash_clean()
35 accel_hash->num_direct_entries = 0; in zend_accel_hash_clean()
36 memset(accel_hash->hash_table, 0, sizeof(zend_accel_hash_entry *)*accel_hash->max_num_entries); in zend_accel_hash_clean()
39 void zend_accel_hash_init(zend_accel_hash *accel_hash, uint32_t hash_size) in zend_accel_hash_init() argument
50 accel_hash->num_entries = 0; in zend_accel_hash_init()
51 accel_hash->num_direct_entries = 0; in zend_accel_hash_init()
52 accel_hash->max_num_entries = hash_size; in zend_accel_hash_init()
55 …accel_hash->hash_table = zend_shared_alloc(sizeof(zend_accel_hash_entry *)*accel_hash->max_num_ent… in zend_accel_hash_init()
56 if (!accel_hash->hash_table) { in zend_accel_hash_init()
62 …accel_hash->hash_entries = zend_shared_alloc(sizeof(zend_accel_hash_entry)*accel_hash->max_num_ent… in zend_accel_hash_init()
63 if (!accel_hash->hash_entries) { in zend_accel_hash_init()
67 memset(accel_hash->hash_table, 0, sizeof(zend_accel_hash_entry *)*accel_hash->max_num_entries); in zend_accel_hash_init()
74 zend_accel_hash_entry* zend_accel_hash_update(zend_accel_hash *accel_hash, zend_string *key, bool i… in zend_accel_hash_update() argument
92 index = hash_value % accel_hash->max_num_entries; in zend_accel_hash_update()
95 entry = accel_hash->hash_table[index]; in zend_accel_hash_update()
108 accel_hash->num_direct_entries--; in zend_accel_hash_update()
121 if (accel_hash->num_entries == accel_hash->max_num_entries) { in zend_accel_hash_update()
125 entry = &accel_hash->hash_entries[accel_hash->num_entries++]; in zend_accel_hash_update()
130 accel_hash->num_direct_entries++; in zend_accel_hash_update()
136 entry->next = accel_hash->hash_table[index]; in zend_accel_hash_update()
137 accel_hash->hash_table[index] = entry; in zend_accel_hash_update()
141 static zend_always_inline void* zend_accel_hash_find_ex(zend_accel_hash *accel_hash, zend_string *k… in zend_accel_hash_find_ex() argument
151 index = hash_value % accel_hash->max_num_entries; in zend_accel_hash_find_ex()
153 entry = accel_hash->hash_table[index]; in zend_accel_hash_find_ex()
179 void* zend_accel_hash_find(zend_accel_hash *accel_hash, zend_string *key) in zend_accel_hash_find() argument
181 return zend_accel_hash_find_ex(accel_hash, key, 1); in zend_accel_hash_find()
187 zend_accel_hash_entry* zend_accel_hash_find_entry(zend_accel_hash *accel_hash, zend_string *key) in zend_accel_hash_find_entry() argument
189 return (zend_accel_hash_entry *)zend_accel_hash_find_ex(accel_hash, key, 0); in zend_accel_hash_find_entry()
192 int zend_accel_hash_unlink(zend_accel_hash *accel_hash, zend_string *key) in zend_accel_hash_unlink() argument
202 index = hash_value % accel_hash->max_num_entries; in zend_accel_hash_unlink()
204 entry = accel_hash->hash_table[index]; in zend_accel_hash_unlink()
209 accel_hash->num_direct_entries--; in zend_accel_hash_unlink()
214 accel_hash->hash_table[index] = entry->next; in zend_accel_hash_unlink()