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

Developer

resources

Heap allocation for dynamic Brew MP applications

Dynamic modules are stored on the device as files in the file system, and read into memory at run-time.

Dynamic Brew MP applications can call MALLOC() and REALLOC() or IHeap1_Malloc() and IHeap1_Realloc() to allocate memory.

At initialization, when MIF files of existing applications on a device are enumerated, Brew MP associates the applications with a particular module. An application runs in its own context, known as the application context. Each application context corresponds to a module context, as shown in the figure below for Applets B1 and B2. The 32-bit ID that Brew MP uses to track an application's memory is actually a per-module ID. This means that two applets coming from the same module have the same 32-bit ID.