Precompiling C++ for Garbage Collection

Our research is concerned with compiler-independent, efficient and convenient garbage collection for C++. Most collectors proposed for C++ have either been implemented in a library or in a compiler. As an intermediate step between those two, this paper proposes using precompilation techniques to augment a C++ source program with code to allow mostly type-accurate garbage collection. There are two key precompiler transformations. The first is automatic generation of *smart pointer* classes. The precompiler defines the smart pointer classes and the user utilizes them instead of raw pointers. These smart pointers supply functionality that allows the collector to locate the root set for collection. The second transformation augments the C++ program with code that allows the garbage collector to locate internal pointers within objects. This paper describes the precompiler and the garbage collector. The paper includes a brief (1500 word) survey of related techniques.

[1]  Bjarne Stroustrup,et al.  The C++ Programming Language, Second Edition , 1991 .

[2]  Daniel R. Edelson Smart Pointers: They're Smart, But They're Not Pointers , 1992, C++ Conference.

[3]  Andrew F. Ginter Cooperative garbage collectors using smart pointers in the C++ programming language , 1991 .

[4]  Hans-J Boehm Simple Gc-safe Compilation , 1991 .

[5]  Marc Shapiro,et al.  Robust, distributed references and acyclic garbage collection , 1992, PODC '92.

[6]  Ira Pohl,et al.  A Copying Collector for C++ , 1991, C++ Conference.

[7]  Marc Shapiro,et al.  Object-orientation in operating systems (workshop session) , 1990, OOPSLA/ECOOP '90.

[8]  Daniel G. Bobrow,et al.  Combining generational and conservative garbage collection: framework and implementations , 1989, POPL '90.

[9]  Daniel R. Edelson COMPARING TWO GARBAGE COLLECTORS FOR C , 1992 .

[10]  Andrew W. Appel,et al.  Runtime tags aren't necessary , 1989, LISP Symb. Comput..

[11]  Thomas W. Christopher,et al.  Reference count garbage collection , 1984, Softw. Pract. Exp..

[12]  Marc Shapiro,et al.  Distributed references and acyclic garbage collection , 1992, PODC 1992.

[13]  Benjamin Goldberg,et al.  Tag-free garbage collection for strongly typed programming languages , 1991, PLDI '91.

[14]  Hans-Juergen Boehm,et al.  Garbage collection in an uncooperative environment , 1988, Softw. Pract. Exp..

[15]  Dennis G. Kafura,et al.  Garbage collection of actors , 1990, OOPSLA/ECOOP '90.

[16]  Bjarne Stroustrup,et al.  The Annotated C++ Reference Manual , 1990 .

[17]  Slocum Miller James,et al.  Multischeme : a parallel processing system based on MIT scheme , 1987 .

[18]  Benjamin G. Zorn,et al.  The measured cost of conservative garbage collection , 1993, Softw. Pract. Exp..

[19]  B. Kennedy The Features of the Object-Oriented Abstract Type Hierarchy (OATH) , 1991, C++ Conference.

[20]  K. Karplus Using if-then-else DAGs for multi-level logic minimization , 1989 .

[21]  Andrew W. Appel,et al.  Virtual memory primitives for user programs , 1991, ASPLOS IV.

[22]  E. P. Wentworth Pitfalls of conservative garbage collection , 1990, Softw. Pract. Exp..

[23]  Bjarne Stroustrup,et al.  C++ Programming Language , 1986, IEEE Softw..

[24]  Al Stevens,et al.  C programming , 1990 .

[25]  David L. Detlefs,et al.  Concurrent garbage collection for C , 1990 .

[26]  Joel F. Bartlett,et al.  Compacting garbage collection with ambiguous roots , 1988, LIPO.

[27]  Scott Shenker,et al.  Mostly parallel garbage collection , 1991, PLDI '91.

[28]  John Thomas Berry,et al.  Advanced C Programming , 1986 .

[29]  Bjarne Stroustrup,et al.  The C++ programming language (2nd ed.) , 1991 .

[30]  Marc Shapiro,et al.  SOS: An Object-Oriented Operating System - Assessment and Perspectives , 1989, Comput. Syst..

[31]  Bjarne Stroustrup The Evolution of C , 1987 .

[32]  Marc Shapiro,et al.  Implementing references as chains of links , 1992, [1992] Proceedings of the Second International Workshop on Object Orientation in Operating Systems.