示例#1
0
void tableDestroy (
				Table** ppTab
				)
{
	assert(ppTab != NULL);
	assert(*ppTab != NULL);

	tableRelease(*ppTab);
	*ppTab = NULL;
}
示例#2
0
/*
 * 释放cuckoo hashing内存
 */
void cuckooDestroy(CuckooHash *cuckoo_hash)
{
	assert(cuckoo_hash != NULL);
	int table_num = cuckoo_hash->table_num;
	HashTable **tables = cuckoo_hash->hash_tables;
	hashfunc_t *functions = cuckoo_hash->functions;
	HashValue *hv_arr = cuckoo_hash->hv_arr;
	int i = 0;
	
	for(i = 0; i < table_num; i++) {
		if(NULL != tables[i])
			tableRelease(tables[i]);	
	}

	if(NULL != functions) free(functions);
	if(NULL != hv_arr) free(hv_arr);

	free(cuckoo_hash);	
}