11.07.2015 Views

IAR PowerPac RTOS User Guide

IAR PowerPac RTOS User Guide

IAR PowerPac RTOS User Guide

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

ParameterDescriptionNumBlocks Pointer to memory to be used for the memory pool. Required size is: NumBlocks *(BlockSize + OS_MEMF_SIZEOF_BLOCKCONTROL).BlockSizeSize in bytes of one block.Table 100: OS_MEMF_Create() parameter listAdditional InformationOS_MEMF_SIZEOF_BLOCKCONTROL gives the number of bytes used for control and debug purposes. It is guaranteedto be 0 in release or stack check builds. Before using any memory pool, it has to be created. The debug version oflibraries keeps track of created and deleted memory pools. The release and stack check versions do not.OS_MEMF_Delete()DescriptionDeletes a fixed block size memory pool. After deletion, the memory pool and memory blocks inside this pool can nolonger be used.Prototypevoid OS_MEMF_Delete (OS_MEMF* pMEMF);ParameterDescriptionpMEMFTable 101: OS_MEMF_Delete() parameter listAdditional InformationThis routine is provided for completeness. It is not used in the majority of applications because there is no need todynamically create/delete memory pools.For most applications it is prefered to have a static memory pool design; memory pools are created at startup (beforecalling OS_Start()) and will never be deleted.The debug version of libraries mark the memory pool as deleted.OS_MEMF_Alloc()DescriptionRequests allocation of a memory block. Waits until a block of memory is available.Prototypevoid* OS_MEMF_Alloc (OS_MEMF* pMEMF,int Purpose);ParameterDescriptionpMEMFPurposeTable 102: OS_MEMF_Alloc() parameter listReturn valuePointer to the allocated block.Additional InformationIf there is no free memory block in the pool, the calling task is suspended until a memory block becomes available.The retrieved pointer must be delivered to OS_MEMF_Release() as a parameter to free the memory block. The pointermust not be modified.OS_MEMF_AllocTimed()DescriptionPointer to the control data structure of memory pool.Pointer to the control data structure of memory pool.This is a parameter which is used for debugging purpose only. Its value has no effect on programexecution, but may be remembered in debug builds to allow runtime analysis of memoryallocation problems.Requests allocation of a memory block. Waits until a block of memory is available or the timeout has expired.92<strong>IAR</strong> <strong>PowerPac</strong> <strong>RTOS</strong>for ARM CoresPP<strong>RTOS</strong>-2

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!