A direct approach to control-flow sensitive region-based memory management
- 5 September 2001
- conference paper
- Published by Association for Computing Machinery (ACM)
- p. 175-186
- https://doi.org/10.1145/773184.773203
Abstract
Region-based memory management can be used to control dynamic memory allocations and deallocations safely and efficiently. Existing (direct-style) region systems that statically guarantee region safety---no dereferencing of dangling pointers---are based on refinements of Tofte and Talpin's seminal work on region inference for managing heap memory in stacks of regions.We present a unified Floyd-Hoare Logic inspired region type system for reasoning about and inferring region-based memory management, using a sublanguage of imperative region commands. Our system expresses and performs control-sensitive region management without requiring a stack discipline for allocating and deallocating regions. Furthermore, it captures storage mode analysis and late allocation/early deallocation analysis in a single, expressive, unified logical framework. Explicit region aliasing in combination with reference-counted regions provides flexible, context-sensitive early memory deallocation and simultaneously dispenses with the need for an integrated region alias analysis.In this paper we present the design of our region type system, illustrate its practical expressiveness, compare it to existing region analyses, demonstrate how this eliminates the need for previously required source code rewritings for good memory performance, and describe automatic inference of region commands that give consistently better (or at least equally good) memory performance as existing inference techniques.Keywords
This publication has 14 references indexed in Scilit:
- Typed memory management via static capabilitiesACM Transactions on Programming Languages and Systems, 2000
- Recursion and dynamic data-structures in bounded spacePublished by Association for Computing Machinery (ACM) ,1999
- Monadic encapsulation in MLPublished by Association for Computing Machinery (ACM) ,1999
- Typed memory management in a calculus of capabilitiesPublished by Association for Computing Machinery (ACM) ,1999
- The marriage of effects and monadsPublished by Association for Computing Machinery (ACM) ,1998
- Region-Based Memory ManagementInformation and Computation, 1997
- From region inference to von Neumann machines via region representation inferencePublished by Association for Computing Machinery (ACM) ,1996
- Polymorphic type, region and effect inferenceJournal of Functional Programming, 1992
- Fast allocation and deallocation of memory based on object lifetimesSoftware: Practice and Experience, 1990
- The AED free storage packageCommunications of the ACM, 1967