Lines Matching refs:new

177     HT *new = OPENSSL_zalloc(sizeof(*new));  in ossl_ht_new()  local
179 if (new == NULL) in ossl_ht_new()
182 new->atomic_lock = CRYPTO_THREAD_lock_new(); in ossl_ht_new()
183 if (new->atomic_lock == NULL) in ossl_ht_new()
186 memcpy(&new->config, conf, sizeof(*conf)); in ossl_ht_new()
188 if (new->config.init_neighborhoods != 0) { in ossl_ht_new()
189 new->wpd.neighborhood_len = new->config.init_neighborhoods; in ossl_ht_new()
191 new->wpd.neighborhood_len--; in ossl_ht_new()
192 new->wpd.neighborhood_len |= new->wpd.neighborhood_len >> 1; in ossl_ht_new()
193 new->wpd.neighborhood_len |= new->wpd.neighborhood_len >> 2; in ossl_ht_new()
194 new->wpd.neighborhood_len |= new->wpd.neighborhood_len >> 4; in ossl_ht_new()
195 new->wpd.neighborhood_len |= new->wpd.neighborhood_len >> 8; in ossl_ht_new()
196 new->wpd.neighborhood_len |= new->wpd.neighborhood_len >> 16; in ossl_ht_new()
197 new->wpd.neighborhood_len++; in ossl_ht_new()
199 new->wpd.neighborhood_len = DEFAULT_NEIGH_LEN; in ossl_ht_new()
202 if (new->config.ht_free_fn == NULL) in ossl_ht_new()
203 new->config.ht_free_fn = internal_free_nop; in ossl_ht_new()
205 new->md = OPENSSL_zalloc(sizeof(*new->md)); in ossl_ht_new()
206 if (new->md == NULL) in ossl_ht_new()
209 new->md->neighborhoods = in ossl_ht_new()
210 alloc_new_neighborhood_list(new->wpd.neighborhood_len, in ossl_ht_new()
211 &new->md->neighborhood_ptr_to_free); in ossl_ht_new()
212 if (new->md->neighborhoods == NULL) in ossl_ht_new()
214 new->md->neighborhood_mask = new->wpd.neighborhood_len - 1; in ossl_ht_new()
216 new->lock = ossl_rcu_lock_new(1, conf->ctx); in ossl_ht_new()
217 if (new->lock == NULL) in ossl_ht_new()
220 if (new->config.ht_hash_fn == NULL) in ossl_ht_new()
221 new->config.ht_hash_fn = ossl_fnv1a_hash; in ossl_ht_new()
223 return new; in ossl_ht_new()
226 CRYPTO_THREAD_lock_free(new->atomic_lock); in ossl_ht_new()
227 ossl_rcu_lock_free(new->lock); in ossl_ht_new()
228 if (new->md != NULL) in ossl_ht_new()
229 OPENSSL_free(new->md->neighborhood_ptr_to_free); in ossl_ht_new()
230 OPENSSL_free(new->md); in ossl_ht_new()
231 OPENSSL_free(new); in ossl_ht_new()