예제 #1
0
파일: l2hash.c 프로젝트: zloidemon/eblob
/**
 * 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;
}
예제 #2
0
파일: l2hash.c 프로젝트: abudnik/eblob
/**
 * 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;
}