Exemplo n.º 1
0
/**
 * eblob_l2hash_destroy() - frees memory allocated by eblob_l2hash_init()
 * NB! Caller must manually synchronize calls to eblob_l2hash_destroy()
 */
int eblob_l2hash_destroy(struct eblob_l2hash *l2h)
{
	int err;

	if (l2h == NULL)
		return -EINVAL;

	/* Destroy trees */
	__eblob_l2hash_tree_destroy(&l2h->root);
	__eblob_l2hash_tree_destroy(&l2h->collisions);

	err = pthread_mutex_destroy(&l2h->root_lock);
	free(l2h);

	return err;
}
Exemplo n.º 2
0
/**
 * eblob_l2hash_destroy() - frees memory allocated by eblob_l2hash_init()
 * NB! Caller must manually synchronize calls to eblob_l2hash_destroy()
 */
int eblob_l2hash_destroy(struct eblob_l2hash *l2h)
{
	if (l2h == NULL)
		return -EINVAL;

	/* Destroy trees */
	__eblob_l2hash_tree_destroy(&l2h->root);
	__eblob_l2hash_collision_tree_destroy(&l2h->collisions);

	return 0;
}