void compute_deltat_clean_mem(const hydroparam_t H, hydrowork_t * Hw, hydrovarwork_t * Hvw) { DFree(&Hvw->q, H.nvar * H.nxyt * H.nxystep); DFree(&Hw->e, H.nxyt * H.nxystep); DFree(&Hw->c, H.nxyt * H.nxystep); DFree(&Hw->tmpm1, H.nxystep); DFree(&Hw->tmpm2, H.nxystep); }
/* This gets rid of the "original" bitmap and sets the state to "no transform" */ void ClearBrXform() { FreeBitMap( &origBM ); DFree( origBr.mask ); origBr.mask = NULL; curBrXform = NOXFORM; }
/* Allocate and Free temp Raster --------------- */ void AllocTmpRas() { int plsize = mainRP->BitMap->BytesPerRow*mainRP->BitMap->Rows; DFree( tmpRas.RasPtr ); tmpRas.RasPtr = (BYTE *) ChipAlloc( plsize ); if ( tmpRas.RasPtr == NULL ) { InfoMessage( " Couldnt alloc", "tmpRas. " ); } tmpRas.Size = plsize; mainRP->TmpRas = &tmpRas; /* temp raster for area filling*/ }
int Free(void * pointer) { struct alloc_head * mem_head=(struct alloc_head *)(pointer-sizeof(POINTER_LIST)); switch(mem_head->type) { case ALLOC_TEMP: return TFree(pointer); case ALLOC_STATIC: return SFree(pointer); case ALLOC_DYNAMIC: return DFree(pointer); case ALLOC_CACHE: return CFree(pointer,mem_head->flag); default: return -EINVAL; } }
void FreeTmpRas() { DFree( tmpRas.RasPtr ); tmpRas.RasPtr = NULL; }