#ifdef D_USE_LIPSYNC
 
/*=========================================================================
* LSYbase.c : MEmory management of the LipsSynchs
*
* Version              1.0
* Creation date        27/05/97
* Revision date
*
* That file needs to be compatible for all platforms.
*
* (c) Ubi R&D 1997
*=======================================================================*/
/*
*=======================================================================
Modifications:
*=======================================================================*/
#include "LSerm.h"
#include "LSmem.h"
 
#pragma warning( disable : 4127 4514 )
 
/**************************************************************************/
void *LSY_fn_p_vAlloc(unsigned long lSize)
{
 void *p_vPointer;
 
	Mmg_M_SetModeAlloc4Ch(LipsSynch,E_ucLipsSynchMemoryBlock,C_ucMmgDefaultChannel);
 MMG_fn_vAddMemoryInfo( MMG_C_lTypeGAM , MMG_C_lSubTypeLipSynchro , 0 );
 p_vPointer=(void*)Mmg_fn_p_vAlloc4Ch(lSize,C_ucMmgDefaultChannel);
 memset(p_vPointer,0,lSize);
 if (p_vPointer==NULL)
  M_LipsSynchFatalError(E_uwLipsSynchMemoryPlace);
 
	return (p_vPointer);
}
/**************************************************************************/
#ifndef _FIRE_DEADCODE_U64_
void LSY_fn_vFree(void *p_vPointer)
{
	Mmg_M_SetModeAlloc4Ch(LipsSynch,E_ucLipsSynchMemoryBlock,C_ucMmgDefaultChannel);
	MMG_fn_vAddMemoryInfo( MMG_C_lTypeGAM , MMG_C_lSubTypeLipSynchro , 0 );
	Mmg_fn_vFree4Ch(p_vPointer,C_ucMmgDefaultChannel);
}
/**************************************************************************/
void LSY_fn_vFirstInitLSYMemory(unsigned long _ulLipsSynchMenorySize)
{
	Erm_M_InitErrMsg(LipsSynch);		/* Init the error module*/
 Mmg_M_InitMmg(LipsSynch);
 
 /**** Check the ACP memory module ****/
 Mmg_fn_cCheckAlignmentValidity();
 
 Mmg_M_InitBlock(LipsSynch,E_ucLipsSynchMemoryBlock,_ulLipsSynchMenorySize);
}
#endif /* _FIRE_DEADCODE_U64_ */
/**************************************************************************/
 
#ifndef _FIRE_DEADCODE_U64_ /* Added by RUC */
void LSY_fn_vDesinitLSYMemory(void)
{
 Mmg_M_FreeBlock(LipsSynch,E_ucLipsSynchMemoryBlock);
 Mmg_M_DeleteBlock(LipsSynch,E_ucLipsSynchMemoryBlock);
}
#endif /* _FIRE_DEADCODE_U64_ */ /* Added by RUC */
 
/**************************************************************************/
#ifndef _FIRE_DEADCODE_U64_
void LSY_PrintUsedStaticMemory(void)
{
	Mmg_M_PrintUsedStaticMemoryInModule(LipsSynch);
}
/**************************************************************************/
void LSY_fn_vFreeLipsSynchroBlock(void)
{
 Mmg_M_FreeBlock(LipsSynch,E_ucLipsSynchMemoryBlock);
}
#endif /* _FIRE_DEADCODE_U64_ */
#endif /*  D_USE_LIPSYNC*/
