Affiliation:
1. University of Bonn, Germany
2. Microsoft Research, USA
Abstract
The recently introduced _Perceus_ algorithm can automatically insert
reference count instructions such that the resulting (cycle-free) program is
_garbage free_: objects are freed at the very moment they can no longer be
referenced. An important extension is reuse analysis. This optimization pairs
objects of known size with fresh allocations of the same size and tries to
reuse the object in-place at runtime if it happens to be unique. Unfortunately,
current implementations of reuse analysis are fragile with respect to small
program transformations, or can cause an arbitrary increase in the peak heap
usage. We present a novel _drop-guided_ reuse algorithm that is simpler and
more robust than previous approaches. Moreover, we generalize the linear
resource calculus to precisely characterize garbage-free and frame-limited
evaluations. On each function call, a frame-limited evaluation may hold on to
memory longer if the size is bounded by a constant factor. Using this framework
we show that our drop-guided reuse _is_ frame-limited and find that an
implementation of our new reuse approach in Koka can provide significant
speedups.
Publisher
Association for Computing Machinery (ACM)
Subject
Safety, Risk, Reliability and Quality,Software
Cited by
4 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. The Functional Essence of Imperative Binary Search Trees;Proceedings of the ACM on Programming Languages;2024-06-20
2. FP²: Fully in-Place Functional Programming;Proceedings of the ACM on Programming Languages;2023-08-30
3. Tail Recursion Modulo Context: An Equational Approach;Proceedings of the ACM on Programming Languages;2023-01-09
4. Reference counting with frame limited reuse;Proceedings of the ACM on Programming Languages;2022-08-29