src/backend/utils/sort/logtape.c
/*
 * Close a logical tape set and release all resources.
 */
Close a logical tape set and release all resources.
Close a logical tape set and release all resources .
void
LogicalTapeSetClose(LogicalTapeSet *lts)
{
	LogicalTape *lt;
	IndirectBlock *ib,
			   *nextib;
	int			i;
	BufFileClose(lts->pfile);
	for (i = 0; i < lts->nTapes; i++)
	{
		lt = &lts->tapes[i];
		for (ib = lt->indirect; ib != NULL; ib = nextib)
		{
			nextib = ib->nextup;
			pfree(ib);
		}
		if (lt->buffer)
			pfree(lt->buffer);
	}
	pfree(lts->freeBlocks);
	pfree(lts);
}
void LogicalTapeSetClose ( LogicalTapeSet * lts ) { LogicalTape * lt ; IndirectBlock * ib , * nextib ; int i ; BufFileClose ( lts -> pfile ) ; for ( i = 0 ; i < lts -> nTapes ; i ++ ) { lt = & lts -> tapes [ i ] ; for ( ib = lt -> indirect ; ib != NULL ; ib = nextib ) { nextib = ib -> nextup ; pfree ( ib ) ; } if ( lt -> buffer ) pfree ( lt -> buffer ) ; } pfree ( lts -> freeBlocks ) ; pfree ( lts ) ; }
Close a logical tape set and release all resources.
Close a logical tape set and release all resources .