Resources | developer.brewmp.com Resources | developer.brewmp.com

Developer

resources

Application-layer functions

These functions are optimal for writing Brew MP applications and extensions. They suffice for basic memory management, and are similar to the malloc(), realloc(), and free() functions from the standard C library. Brew MP supports this C stdlib syntax so that applications can use the same functions without having to create object instances for dealing with memory operations.

stdlib (from AEEStdLib.h) and all of its included functions such as MALLOC(), REALLOC(), and FREE() are available only to applications built as MOD; AEEStdLib.h is incompatible with MOD1. MOD1 applications can use the IEnv or IHeap1 interfaces to allocate memory.

Note: The MALLCO and REALLOC functions must locate the appropriate heap. Because there can be one heap for each running app, there may be a slight performance penalty involved in using these functions, compared to using IEnv. For more information, see Broken Link and Criteria for choosing interfaces.

Required Files
AEEStdLib.h
Class ID(s)
Not applicable.
Interface ID
Not applicable.
Location
\platform\system\inc

MALLOC()

This function corresponds to malloc() in the standard C library. It allocates a block of memory of the requested size and returns a pointer to that memory block. By default, memory allocated using MALLOC() is initialized to zero. This behavior can be disabled by performing a bitwise OR of the flag ALLOC_NO_ZMEM with the dwSize parameter.

REALLOC()

This function corresponds to realloc() in the standard C library; it reallocates a memory block and changes its size. By default, any extra memory allocated using REALLOC() is initialized to zero. This behavior can be disabled by performing a bitwise OR of the flag ALLOC_NO_ZMEM with the dwSize parameter.

FREE()

This function corresponds to free() in the standard C library.