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

Developer

resources

Heap allocation for Brew MP extensions

When an application creates an instance of an extension, it instantiates an IModule for that extension. See Module X in the figure below. The memory allocated during instantiation of an extension's IModule is associated with the extension's module context and the memory is tagged with the 32-bit ID value of the extension module context. After the initial instantiation of IModule, any other memory allocated for the instance of the extension is associated with the calling of the application’s module context. This memory is tagged with the calling application’s 32-bit ID.

The following diagram illustrates how memory for the above mentioned configurations is marked. Each color represents a different 32-bit ID or a group of memory that will automatically be freed by Brew MP when the last user of the module exits.