Low-Level Linear Memory Management

Efficient low-level systems need more control over memory than safe high-level languages usually provide. As a result, run-time systems are typically written in unsafe languages such as C. This paper extends previous work on linear types, alias types, regions, and typed garbage collection to give type-safe code more control over memory. The approach is truly low-level: memory consists of a single linear array of words, with load and store operations but no built-in notion of an object. The paper constructs lists and arrays out of the basic linear memory primitives, and then introduces type sequences for building regions of nonlinear data. It then describes a Cheney queue typed garbage collector, implemented safely over regions.

[1]  Mads Tofte,et al.  Region-based Memory Management , 1997, Inf. Comput..

[2]  James Cheney,et al.  A Linearly Typed Assembly Language , 2003 .

[3]  Chris Hawblitzel,et al.  Formal Properties of Linear Memory Types , 2003 .

[4]  David Teller,et al.  Algorithm-Independent Framework for Verifying Integer Constraints , 2000 .

[5]  John C. Reynolds,et al.  Separation logic: a logic for shared mutable data structures , 2002, Proceedings 17th Annual IEEE Symposium on Logic in Computer Science.

[6]  Andrew W. Appel,et al.  Foundational proof-carrying code , 2001, Proceedings 16th Annual IEEE Symposium on Logic in Computer Science.

[7]  Frank Pfenning,et al.  Eliminating array bound checking through dependent types , 1998, PLDI.

[8]  Peter W. O'Hearn,et al.  BI as an assertion language for mutable data structures , 2001, POPL '01.

[9]  Zhong Shao,et al.  A type system for certi .ed binaries , 2002, Foundations of Intrusion Tolerant Systems, 2003 [Organically Assured and Survivable Information Systems].

[10]  Furio Honsell,et al.  A framework for defining logics , 1993, JACM.

[11]  Philip Wadler,et al.  Linear Types can Change the World! , 1990, Programming Concepts and Methods.

[12]  Zhong Shao,et al.  A Syntactic Approach to Foundational Proof-Carrying Code , 2004, Journal of Automated Reasoning.

[13]  Stefan Monnier Typed Regions , 2002 .

[14]  Andrew W. Appel,et al.  Type-preserving garbage collectors , 2001, POPL '01.

[15]  David Walker,et al.  Typed memory management in a calculus of capabilities , 1999, POPL '99.

[16]  Karl Crary,et al.  An expressive, scalable type theory for certified code , 2002, ICFP '02.

[17]  Pascal Fradet,et al.  Shape types , 1997, POPL '97.

[18]  Naoki Kobayashi,et al.  Garbage Collection Based on a Linear Type System , 2000 .

[19]  Zhong Shao,et al.  Principled scavenging , 2001, PLDI '01.

[20]  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).

[21]  Frank Pfenning,et al.  A type theory for memory allocation and data layout , 2003, POPL '03.

[22]  S. Doaitse Swierstra,et al.  Typing dynamic typing , 2002, ICFP '02.

[23]  Lars Birkedal,et al.  Local reasoning about a copying garbage collector , 2004, POPL '04.

[24]  David Walker,et al.  On regions and linear types (extended abstract) , 2001, ICFP '01.

[25]  David Walker,et al.  Alias Types for Recursive Data Structures , 2000, Types in Compilation.

[26]  George C. Necula,et al.  Safe kernel extensions without run-time checking , 1996, OSDI '96.

[27]  Henry G. Baker,et al.  Lively linear Lisp: “look ma, no garbage!” , 1992, SIGP.

[28]  Edward Wei,et al.  Using Low Level Linear Memory Management for Type-Preserving Mark-Sweep Garbage Collector , 2003 .

[29]  David Walker,et al.  Alias Types , 2000, ESOP.

[30]  David Walker,et al.  The logical approach to stack typing , 2003, TLDI '03.

[31]  Sean W. Smith,et al.  Building a high-performance, programmable secure coprocessor , 1999, Comput. Networks.