Typed memory management in a calculus of capabilities
- 1 January 1999
- conference paper
- Published by Association for Computing Machinery (ACM)
- p. 262-275
- https://doi.org/10.1145/292540.292564
Abstract
Region-based memory management is an alternative to standard tracing garbage collection that makes potentially dangerous operations such as memory deallocation explicit but verifiably safe. In this article, we present a new compiler intermediate language, called the Capability Calculus, that supports region-based memory management and enjoys a provably safe type system. Unlike previous region-based type systems, region lifetimes need not be lexically scoped and yet the language may be checked for safety without complex analyses. Therefore, our type system may be deployed in settings such as extensible operating systems where both the performance and safety of untrusted code is important. The central novelty of the language is the use of static capabilities to specify the permissibility of various operations, such as memory access and deallocation. In order to ensure capabilities are relinquished properly, the type system tracks aliasing information using a form of bounded quantification. Moreover, unlike previous work on region-based type systems, the proof of soundness of our type system is relatively simple, employing only standard syntactic techniques. In order to show our language may be used in practice, we show how to translate a variant of Tofte and Talpin''s high-level type-and-effects system for region-based memory management into our language. When combined with known region inference algorithms, this translation provides a way to compile source-level languages to the Capability Calculus.Keywords
This publication has 27 references indexed in Scilit:
- A region inference algorithmACM Transactions on Programming Languages and Systems, 1998
- Solving shape-analysis problems in languages with destructive updatingACM Transactions on Programming Languages and Systems, 1998
- Region-Based Memory ManagementInformation and Computation, 1997
- Safe kernel extensions without run-time checkingPublished by Association for Computing Machinery (ACM) ,1996
- State in HaskellHigher-Order and Symbolic Computation, 1995
- Extensibility safety and performance in the SPIN operating systemPublished by Association for Computing Machinery (ACM) ,1995
- A Syntactic Approach to Type SoundnessInformation and Computation, 1994
- Notions of computation and monadsInformation and Computation, 1991
- Linear logicTheoretical Computer Science, 1987
- Definitional interpreters for higher-order programming languagesPublished by Association for Computing Machinery (ACM) ,1972