IBM
Contents Index Previous Next



Technical Details for Memory Estimations


Allocating Dynamic Memory

Introduction

This section shows when and how dynamic memory allocation is used in the Cmicro Package. It shows,

The Cmicro Package uses a form of dynamic memory management for the following objects:

However, real dynamic memory management is used only in one case, namely for SDL signals, if a signal carries parameters with more than a few bytes.

This means that the Cmicro Kernel has its own memory management to handle processes, signals, and timers. This is done in such a way that each of these 3 objects are managed separately. For each of these 3 objects, a separate fixed memory area is reserved during compilation time, i.e. the area that handles processes cannot be reused to handle timers. This seems to be a restriction but in many micro controller applications users have to fix an upper limit of processes, signals and timers which can be handled in parallel during run time.

Processes

Processes are handled without dynamic memory allocation functions. The user has to specify an upper limit of process instances in the SDL diagram separately for each SDL process. For each process instance, there is a variable which is statically allocated.

Signals with and without Parameters

Cmicro signals are both ordinary SDL signals as well as timer signals. Where timers are implemented without parameters and can therefore be regarded as signals without parameters.

Timers

For timers, no malloc and free functions are used. The Cmicro SDL to C Compiler evaluates the amount of timers in the system and generates a C constant, which is then used in the Cmicro Kernel to define an array for timers.


http://www.ibm.com/rational
Contents Index Previous Next