A conservative garbage collector with ambiguous roots for static typechecking languages

  • Emmanuel Chailloux
Functional Languages
Part of the Lecture Notes in Computer Science book series (LNCS, volume 637)


In a static typechecking language, such as ML, the type information produced by the typechecker can be forgotten during execution. But in many cases, a minimal type information (tag) is needed for the Garbage Collector (GC). In this paper, I propose a simple, safe and efficient GC algorithm which does not use any tags to distinguish immediate values and pointers.

This GC is a conservative Mark&Sweep (which does not move objects) with ambiguous roots (there is a possibility of ambiguity between immediate values and pointers). It is used for a runtime library added to C for an ML compiler to C (CeML) where basic data types are identical to those in C (int, float). However the GC uses a disambiguating strategy which is shown to be safe. It can be used also for other polymorphic languages with static typechecking and uniform data representation.


Data Representation Garbage Collection Memory Management Functional Language Chunk Size 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Appel, A. Runtime Tags Aren't Necessary. Lisp and Symbolic Computation (1989).Google Scholar
  2. 2.
    Appel, A., McQueen, D., and David, B. A Standard ML Compiler. Functional Programming Languages and Computer Architecture (1987).Google Scholar
  3. 3.
    Bartlett, J. F. Compacting Garbage Collection with Ambiguous Roots. Tech. Rep. 88/2, Digital Equipement Corporation (WRL), Feb. 1988.Google Scholar
  4. 4.
    Boehm, H., and Weiser, M. Garbage Collection in an Uncooperative Environment. Software — Practice and Experience (Sept. 1988).Google Scholar
  5. 5.
    Chailloux, E. Compilation des langages fonctionnels: CeML un traducteur ML vers C. Thèse d'université, Université Paris VII, Nov. 1991.Google Scholar
  6. 6.
    Chailloux, E. An Efficient Way of Compiling ML to C. In Workshop on ML and its Applications (San Francisco, June 1992), ACM SIGPLAN.Google Scholar
  7. 7.
    Edelson, D. A Mark-and-Sweep Collector for C++. In Principles Of Programming Languages (Albuquerque, 1992), ACM.Google Scholar
  8. 8.
    Goldberg, B. Tag-Free Garbage Collection for Strongly Typed Programming Languages. In Programming Language Design and Implementation (1991), ACM.Google Scholar
  9. 9.
    Johnsson, T. Lambda lifting: transforming programs to recursive equations. In Conference on Functional Programing Languages and Computer Architecture. LNCS 201 (Nancy, 1985), ACM, Springer Verlag.Google Scholar
  10. 10.
    Knuth, D. The Art of Computer Programming: Fundamental Algorithms, vol. 1. Addison Wesley 3821, 1973.Google Scholar
  11. 11.
    Leroy, X. The ZINC experiment: an economical implementation of the ML language. Tech. Rep. 117, INRIA, Feb. 1990.Google Scholar
  12. 12.
    Leroy, X. Unboxed Objects and Polymorphic Typing. In Principles Of Programming Languages (Albuquerque, 1992), ACM.Google Scholar
  13. 13.
    McCarthy, J. Recursive Functions of Symbolic Expressions and Their Computation by Machine. Communications of the ACM (1960).Google Scholar
  14. 14.
    Minsky, M. A Lisp Garbage Collector Algorithm Using Serial Secondary Storage. Tech. Rep. Memo 58, MIT, Cambridge, Massachussets, 1963.Google Scholar
  15. 15.
    Morrison, R., Dearle, A., Connor, R. C. H., and Brown, L. An Ad Hoc Approach to the Implementation of Polymorphism. In Transaction on Programming Languages ans Systems (1991), ACM.Google Scholar
  16. 16.
    Steele, G. L. Data Representation in PDP-10 Mac Lisp. In MACSYMA Users Conference (1977).Google Scholar
  17. 17.
    Tarditi, D., and Acharya, A. A Guide to SML2C. Tech. rep., CMU-CS, June 1991.Google Scholar
  18. 18.
    Weis, P., Aponte, M. V., Laville, A., Mauny, M., and Suarez, A. The CAML Reference Manual. Tech. Rep. 121, INRIA, Sept. 1990.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1992

Authors and Affiliations

  • Emmanuel Chailloux
    • 1
    • 2
  1. 1.LIENS (URA 1327): Laboratoire d'Informatique de l'École Normale SupérieureParis Cedex 05France
  2. 2.LITP (URA 248): Laboratoire d'Informatique Théorique et ProgrammationInstitut Blaise PascalParis Cedex 05France

Personalised recommendations