Garbage collection safety for region-based memory management

  • Authors:
  • Martin Elsman

  • Affiliations:
  • IT University of Copenhagen, Copenhagen, Denmark

  • Venue:
  • Proceedings of the 2003 ACM SIGPLAN international workshop on Types in languages design and implementation
  • Year:
  • 2003

Quantified Score

Hi-index 0.00

Visualization

Abstract

In this paper, we prove the safety of integrating region-based memory management and Cheney-style copying garbage collection. The safety property relies on a refinement of the region typing rules that forbids dangling pointers during evaluation.To accommodate the triggering of garbage collection at any step in the evaluation process, we base our type-safety result for the region-based system on a small-step contextual semantics and show that whenever a well-typed expression reduces to another expression, possibly by deallocating a region, then no dangling pointer is introduced. Because there are no dangling pointers in the initial heap, no dangling pointers appear during evaluation.Although in principle, the refinement of the region typing rules leads to less flexibility and can cause worse memory behavior than when dangling pointers are permitted, experiments show that, for a range of benchmark programs, the refinement has little effect on overall memory behavior.