Exemplo n.º 1
0
//*************************************************************
//** This is the implementation of ~BufMgr
//************************************************************
BufMgr::~BufMgr(){
  // put your code here for flush all dirty pages in the pool to disk before
	//deallocating buffer pool in main memory
//	bufPool = NULL;
//	free(bufPool);
	flushAllPages();
	delete[] bufPool;
	delete[] bufDescr;
}
Exemplo n.º 2
0
//*************************************************************
//** This is the implementation of ~BufMgr
//************************************************************
BufMgr::~BufMgr(){
	flushAllPages();
	int* z = new int[numbuf];
	for (int i = 0; i < numbuf; i++)
		z[i] = 1;
	for (int i = 0; i < freeFrames.size(); i++)
		z[freeFrames[i]] = 0;
	for (int i = 0; i < numbuf; i++)
		if (z[i])
			deleteFrame(i);
	delete [] bufDescr;
	delete [] bufPool;
	delete hashTable;
	delete lhm;
  // put your code here
}