Lines Matching refs:new

188     HT *new = OPENSSL_zalloc(sizeof(*new));  in ossl_ht_new()  local
190 if (new == NULL) in ossl_ht_new()
193 new->atomic_lock = CRYPTO_THREAD_lock_new(); in ossl_ht_new()
194 if (new->atomic_lock == NULL) in ossl_ht_new()
197 memcpy(&new->config, conf, sizeof(*conf)); in ossl_ht_new()
199 if (new->config.init_neighborhoods != 0) { in ossl_ht_new()
200 new->wpd.neighborhood_len = new->config.init_neighborhoods; in ossl_ht_new()
202 new->wpd.neighborhood_len--; in ossl_ht_new()
203 new->wpd.neighborhood_len |= new->wpd.neighborhood_len >> 1; in ossl_ht_new()
204 new->wpd.neighborhood_len |= new->wpd.neighborhood_len >> 2; in ossl_ht_new()
205 new->wpd.neighborhood_len |= new->wpd.neighborhood_len >> 4; in ossl_ht_new()
206 new->wpd.neighborhood_len |= new->wpd.neighborhood_len >> 8; in ossl_ht_new()
207 new->wpd.neighborhood_len |= new->wpd.neighborhood_len >> 16; in ossl_ht_new()
208 new->wpd.neighborhood_len++; in ossl_ht_new()
210 new->wpd.neighborhood_len = DEFAULT_NEIGH_LEN; in ossl_ht_new()
213 if (new->config.ht_free_fn == NULL) in ossl_ht_new()
214 new->config.ht_free_fn = internal_free_nop; in ossl_ht_new()
216 new->md = OPENSSL_zalloc(sizeof(*new->md)); in ossl_ht_new()
217 if (new->md == NULL) in ossl_ht_new()
220 new->md->neighborhoods = in ossl_ht_new()
221 alloc_new_neighborhood_list(new->wpd.neighborhood_len, in ossl_ht_new()
222 &new->md->neighborhood_ptr_to_free); in ossl_ht_new()
223 if (new->md->neighborhoods == NULL) in ossl_ht_new()
225 new->md->neighborhood_mask = new->wpd.neighborhood_len - 1; in ossl_ht_new()
227 new->lock = ossl_rcu_lock_new(1, conf->ctx); in ossl_ht_new()
228 if (new->lock == NULL) in ossl_ht_new()
231 if (new->config.ht_hash_fn == NULL) in ossl_ht_new()
232 new->config.ht_hash_fn = fnv1a_hash; in ossl_ht_new()
234 return new; in ossl_ht_new()
237 CRYPTO_THREAD_lock_free(new->atomic_lock); in ossl_ht_new()
238 ossl_rcu_lock_free(new->lock); in ossl_ht_new()
239 if (new->md != NULL) in ossl_ht_new()
240 OPENSSL_free(new->md->neighborhood_ptr_to_free); in ossl_ht_new()
241 OPENSSL_free(new->md); in ossl_ht_new()
242 OPENSSL_free(new); in ossl_ht_new()