API Reference | developer.brewmp.com API Reference | developer.brewmp.com

Developer

API Reference

IHEAP_CHECKAVAIL()

Brew Release
Brew MP 1.0.2
See Also
IHeap IHEAP_GetMemStats
Description
This function checks whether a memory block of the given size can be allocated. The function does not do any actual allocation of memory. It returns TRUE or FALSE indicating whether or not it is possible to allocate a block of the given size.
The use of this function is discouraged. see the Comments section.
Params
pIHeap
[]:
Pointer to the IHeap interface object.
dwSize
[]:
Size of the block whose allocation needs to be verified.
Interface
  • IHEAP
Prototype
  • boolean IHEAP_CheckAvail(IHeap * pIHeap, uint32 dwSize);
    
Return
  • TRUE: if a block of the given size can be allocated. FALSE: if unsuccessful or if a block of the given size cannot be allocated.
Side Effect
  • This function may walk through the heap and collapse any adjacent free blocks.
Comments
The use of this function is discouraged; in a multi-threaded environment, it is possible that the heap status may change at any time, so the return value from IHEAP_CheckAvail() is not guaranteed to be accurate. The return value does not accurately predict the success or failure of an allocation attempt, even if the allocation attempt is tried immediately upon return from IHEAP_CheckAvail().