Analysis of functional programs to detect run-time garbage cells
- 1 October 1988
- journal article
- Published by Association for Computing Machinery (ACM) in ACM Transactions on Programming Languages and Systems
- Vol. 10 (4), 555-578
- https://doi.org/10.1145/48022.48025
Abstract
We propose a method for detecting the generation of garbage cells by analyzing a source text written in a functional programming language which uses ordinary linked lists to implement list-type values. For a subexpression such as F ( G ( . . . )) in a program where the function values of F and G are of list type, if a cell c is created during the computation of G and if c does not appear in a list-type value of F , then c becomes a garbage cell at the end of the computation of F . We discuss this problem on the basis of formal languages derived from the functional program text and show some sufficient conditions that predict the generation of garbage cells. Also, we give an efficient algorithm to detect at compile time the generation of garbage cells which are linearly linked. We have implemented these algorithms in an experimental LISP system. By executing several sample programs on the system, we conclude that our method is effective in detecting the generation of garbage cells.Keywords
This publication has 7 references indexed in Scilit:
- Compiling and optimizing methods for the functional language ASL/FScience of Computer Programming, 1986
- Performance and Evaluation of LISP SystemsPublished by MIT Press ,1985
- Type inference and type checking for functional programming languagesPublished by Association for Computing Machinery (ACM) ,1984
- Garbage Collection of Linked Data StructuresACM Computing Surveys, 1981
- Shifting garbage collection overhead to compile timeCommunications of the ACM, 1977
- An empirical study of list structure in LispCommunications of the ACM, 1977
- An efficient, incremental, automatic garbage collectorCommunications of the ACM, 1976