| Home > Publications > Reports > Informatics (CW) |
CW 278
N. Mazur, G. Janssens and M. Bruynooghe
Towards memory reuse for Mercury
Abstract
While Mercury allows destructive input/unique output modes which direct the compiler to reuse memory, use of these modes is very cumbersome for the programmer. Moreover it does not fit the declarative programming paradigm where the programmer has not to worry about the details of memory management. The paper reports on some experiments with a prototype of an analyser which aims at detecting memory available for reuse. The prototype is based on the live-structure analysis developed by us for logic programs extended with declarations. The prototype has been applied on a module of the Mercury compiler and finds most of the opportunities for reuse. With some modifications, it will be able to find all. The paper also develops the principles of a module based analysis which is essential for the analysis of large Mercury programs with code distributed over many modules.
report.pdf / mailto: N. Mazur
