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

Developer

API Reference

IREALLOC_ERRMALLOC()

Brew Release
Brew MP 1.0.2
See Also
IRealloc_ErrRealloc() IRealloc_ErrMallocNoZI() _HEAP_DEBUG IRealloc_ErrMallocName()
Description
Helper function for doing allocations.
Params
piRealloc
[]:
pointer to the IRealloc interface
nSize
[]:
the requested size of the block
ppOut
[]:
(out) on exit, *ppOut will have the new pointer to the block, or NULL if no block was allocated.
Prototype
  •    int IRealloc_ErrMalloc(IRealloc *piRealloc,
                              int nSize,
                              void **ppOut);
    
Return
  • AEE_SUCCESS - Allocation (or free) was successful AEE_ENOMEMORY - Not enough memory to fulfill the request AEE_EHEAP - An internal heap error was detected Another error from AEEStdErr.h, if appropriate
Side Effect
  • None
Comments
This helper sets *ppOut to NULL to indicate that a new allocation is requested, and then chains to IRealloc_ErrRealloc(). Any newly allocated space is guaranteed to be zero-filled. When zero-filled allocation is not required, the non-zero-filling alternative IRealloc_ErrMallocNoZI() may be more efficient. If _HEAP_DEBUG is defined to a non-zero value, IRealloc_ErrMalloc() is silently converted to IRealloc_ErrMallocName() with a debug name containing the source file name and line number where the method is used. Negative values for nSize should be avoided.