예제 #1
0
파일: aystar.cpp 프로젝트: Voxar/OpenTTD
/*
 * This function frees the memory it allocated
 */
static void AyStarMain_Free(AyStar *aystar)
{
	aystar->OpenListQueue.free(&aystar->OpenListQueue, false);
	/* 2nd argument above is false, below is true, to free the values only
	 * once */
	delete_Hash(&aystar->OpenListHash, true);
	delete_Hash(&aystar->ClosedListHash, true);
#ifdef AYSTAR_DEBUG
	printf("[AyStar] Memory free'd\n");
#endif
}
예제 #2
0
파일: hash.c 프로젝트: AnaZugravu/HashTable
Hash resize_Hash(Hash H, unsigned int newLength){
	List l;
	List_Iter it;
	unsigned int i;
	Hash newHash;

	assert(newLength);

	newHash = new_Hash(newLength);

	for (i = 0; i < H->length; ++i){
		l = H->lists[i];
		it = begin_List(l);
		while (it != end_List(l)){
			add_Hash(newHash, getElem_List(l, it));

			it = next_List(l, it);
		}
	}

	delete_Hash(H);

	return newHash;
}