E cient low-level systems such as garbage collectors need more control over memory than safe high-level languages usually provide. Due to this constraint, garbage collectors are typically written in unsafe languages such as C. A collector of this form usually resides as a trusted primitive runtime service outside the model of the programming language. The type safety of these languages depends on the assumption that the garbage collector will not violate any typing invariants. However, no realistic systems provide proof of this assumption. A garbage collector written in a strongly typed language can guarantee not only the safety of the garbage collector and the program being garbage collected (mutator), but also the interaction between the collector and the mutator. Removing the garbage collector from the trusted computing base has many additional bene ts: Untrusted code could be given more control over memory management without sacri cing security. Low-level code such as device drivers could interface in a safe way with a garbage collector. For these and the growing prevalence of garbage collectors in the typical programming system necessitate a safe solution. Previous research by Wang et al introduced a safe copying collector based on regions, where the live graph structure of the heap is copied from an old region to a newer region. This paper seeks to improve the e ciency of type-preserving garbage collection with the introduction of a type-preserving mark and sweep garbage collector.
[1]
David Walker,et al.
Alias Types for Recursive Data Structures
,
2000,
Types in Compilation.
[2]
Frank Pfenning,et al.
Eliminating array bound checking through dependent types
,
1998,
PLDI.
[3]
Philip Wadler,et al.
Linear Types can Change the World!
,
1990,
Programming Concepts and Methods.
[4]
Andrew W. Appel,et al.
Type-preserving garbage collectors
,
2001,
POPL '01.
[5]
William Pugh,et al.
The Omega test: A fast and practical integer programming algorithm for dependence analysis
,
1991,
Proceedings of the 1991 ACM/IEEE Conference on Supercomputing (Supercomputing '91).
[6]
David Walker,et al.
On regions and linear types (extended abstract)
,
2001,
ICFP '01.
[7]
Leslie Lamport,et al.
On-the-fly garbage collection: an exercise in cooperation
,
1975,
CACM.
[8]
Zhong Shao,et al.
Principled scavenging
,
2001,
PLDI '01.