A direct approach to control-flow sensitive region-based memory management

  • Authors:
  • Fritz Henglein;Henning Makholm;Henning Niss

  • Affiliations:
  • The IT University of Copenhagen, DENMARK;University of Copenhagen, DENMARK;University of Copenhagen, DENMARK

  • Venue:
  • Proceedings of the 3rd ACM SIGPLAN international conference on Principles and practice of declarative programming
  • Year:
  • 2001

Quantified Score

Hi-index 0.00

Visualization

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.