kernels/linux-2.4.0/drivers/video/sis/sis_main.c
/*
 *  Frees an off-screen heap allocation.
 */
Frees an off-screen heap allocation.
Frees an off - screen heap allocation .
static struct OH *poh_free(unsigned long base)
{
	struct OH *pohThis;
	struct OH *pohFreed;
	struct OH *pohPrev;
	struct OH *pohNext;
	unsigned long ulUpper;
	unsigned long ulLower;
	int foundNode = 0;
	pohFreed = heap.ohUsed.pohNext;
	while (pohFreed != &heap.ohUsed) {
		if (pohFreed->ulOffset == base) {
			foundNode = 1;
			break;
		}
		pohFreed = pohFreed->pohNext;
	}
	if (!foundNode)
		return (NULL);
	heap.ulMaxFreeSize += pohFreed->ulSize;
	pohPrev = pohNext = NULL;
	ulUpper = pohFreed->ulOffset + pohFreed->ulSize;
	ulLower = pohFreed->ulOffset;
	pohThis = heap.ohFree.pohNext;
	while (pohThis != &heap.ohFree) {
		if (pohThis->ulOffset == ulUpper) {
			pohNext = pohThis;
		}
			else if ((pohThis->ulOffset + pohThis->ulSize) ==
				 ulLower) {
			pohPrev = pohThis;
		}
		pohThis = pohThis->pohNext;
	}
	delete_node(pohFreed);
	if (pohPrev && pohNext) {
		pohPrev->ulSize += (pohFreed->ulSize + pohNext->ulSize);
		delete_node(pohNext);
		free_node(pohFreed);
		free_node(pohNext);
		return (pohPrev);
	}
	if (pohPrev) {
		pohPrev->ulSize += pohFreed->ulSize;
		free_node(pohFreed);
		return (pohPrev);
	}
	if (pohNext) {
		pohNext->ulSize += pohFreed->ulSize;
		pohNext->ulOffset = pohFreed->ulOffset;
		free_node(pohFreed);
		return (pohNext);
	}
	insert_node(&heap.ohFree, pohFreed);
	return (pohFreed);
}
static struct OH * poh_free ( unsigned long base ) { struct OH * pohThis ; struct OH * pohFreed ; struct OH * pohPrev ; struct OH * pohNext ; unsigned long ulUpper ; unsigned long ulLower ; int foundNode = 0 ; pohFreed = heap . ohUsed . pohNext ; while ( pohFreed != & heap . ohUsed ) { if ( pohFreed -> ulOffset == base ) { foundNode = 1 ; break ; } pohFreed = pohFreed -> pohNext ; } if ( ! foundNode ) return ( NULL ) ; heap . ulMaxFreeSize += pohFreed -> ulSize ; pohPrev = pohNext = NULL ; ulUpper = pohFreed -> ulOffset + pohFreed -> ulSize ; ulLower = pohFreed -> ulOffset ; pohThis = heap . ohFree . pohNext ; while ( pohThis != & heap . ohFree ) { if ( pohThis -> ulOffset == ulUpper ) { pohNext = pohThis ; } else if ( ( pohThis -> ulOffset + pohThis -> ulSize ) == ulLower ) { pohPrev = pohThis ; } pohThis = pohThis -> pohNext ; } delete_node ( pohFreed ) ; if ( pohPrev && pohNext ) { pohPrev -> ulSize += ( pohFreed -> ulSize + pohNext -> ulSize ) ; delete_node ( pohNext ) ; free_node ( pohFreed ) ; free_node ( pohNext ) ; return ( pohPrev ) ; } if ( pohPrev ) { pohPrev -> ulSize += pohFreed -> ulSize ; free_node ( pohFreed ) ; return ( pohPrev ) ; } if ( pohNext ) { pohNext -> ulSize += pohFreed -> ulSize ; pohNext -> ulOffset = pohFreed -> ulOffset ; free_node ( pohFreed ) ; return ( pohNext ) ; } insert_node ( & heap . ohFree , pohFreed ) ; return ( pohFreed ) ; }
Frees an off-screen heap allocation.
Frees an off - screen heap allocation .