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

Developer

API Reference

IHEAP_REALLOC()

Brew Release
Brew MP 1.0.2
See Also
Description
This function reallocates a memory block and changes its size. By default, any extra memory allocated using IHEAP_Realloc() is initialized to zero. This behavior can be disabled by performing a bitwise OR of the flag ALLOC_NO_ZMEM with the dwNewSize parameter.
Use of this method is discouraged. Use REALLOC() instead.
Params
pIHeap
[]:
Pointer to the IHeap Interface object.
pMemBlock
[]:
Pointer to the memory block that needs to be reallocated. If pMemblock is NULL, this function behaves the same way as IHEAP_Malloc() and allocates a new block of dwNewSize bytes.
dwNewSize
[]:
Specifies the new size of the memory block (optionally OR'ed with ALLOC_NO_ZMEM).
Interface
  • IHEAP
Prototype
  • void * IHEAP_Realloc
    (
    IHeap * pIHeap, 
    void * pMemBlock, 
    uint32 dwNewSize
    );
    
Return
  • Pointer to the reallocated block: If successful. NULL: Failure.
Side Effect
  • If the heap cannot immediately satisfy the request, this call may send a notification to apps in the system asking them to release unneeded memory; if this doesn't free up enough memory, background applications may be closed in order to satisfy the request.
Comments
Use of this method is discouraged. Use REALLOC() instead. The return value is NULL if the size is 0 (zero) and pMemBlock is valid, or if there is not enough available memory to expand pMemBlock to the given size. In the first case, the original block is freed. In the second, the original block is unchanged.