Check runtime system memory leaks

To improve the quality of the runtime system, fglrun supports the -M / -m options to count the creation of built-in class objects and some internal objects. This allows to check for memory leaks in the runtime system: The runtime system counts the object creations and destructions for each class. The right-most column of the output is the different between created and destroyed objects, it must show a zero for all type of objects.

The options described here are provided for debugging purpose only. The output format is subject of changes. These option can also be removed in a next version of the product.

$ fglrun -M stores.42r 
FunctionI        :       10 -      10 =      0 
Module           :        3 -       3 =      0
... 
FieldType        :       19 -      19 =      0

The -M option displays memory counters at the end of the program execution.

The -m option checks for memory leaks, and displays memory counters at the end of the program execution if leaks were found.

Each line shows the number of objects allocated, and the number of objects freed. If the difference is not zero, there is a memory leak.

If you are doing automatic regression tests, we recommend that you run all your programs with fglrun -m to check for memory leaks in the runtime system.