{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,9,30]],"date-time":"2026-09-30T03:23:08Z","timestamp":1790738588286,"version":"4.1.0"},"reference-count":50,"publisher":"Association for Computing Machinery (ACM)","issue":"PLDI","license":[{"start":{"date-parts":[[2023,6,6]],"date-time":"2023-06-06T00:00:00Z","timestamp":1686009600000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0\/"}],"content-domain":{"domain":["dl.acm.org"],"crossmark-restriction":true},"short-container-title":["Proc. ACM Program. Lang."],"published-print":{"date-parts":[[2023,6,6]]},"abstract":"<jats:p>Region inference offers a mechanism to reduce (and sometimes entirely remove) the need for reference-tracing garbage collection by inferring where to insert allocation and deallocation instructions in a program at compile time. When the mechanism is combined with techniques for reference-tracing garbage collection, which is helpful in general to support programs with very dynamic memory behaviours, it turns out that region-inference is complementary to adding generations to a reference-tracing collector. However, region-inference and the associated region-representation analyses that make such a memory management strategy perform well in practice are complex, both from a theoretical point-of-view and from an implementation point-of-view.<\/jats:p><jats:p>In this paper, we demonstrate a soundness problem with existing theoretical developments, which have to do with ensuring that, even for higher-order polymorphic programs, no dangling-pointers appear during a reference-tracing collection. This problem has materialised as a practical soundness problem in a real implementation based on region inference. As a solution, we present a modified, yet simple, region type-system that captures garbage-collection effects, even for polymorphic higher-order code, and outline how region inference and region-representation analyses are adapted to the new type system. The new type system allows for associating simpler region type-schemes with functions, compared to original work, makes it possible to combine region-based memory management with partly tag-free reference-tracing (and generational) garbage-collection, and repairs previously derived work that is based on the erroneous published results.<\/jats:p>","DOI":"10.1145\/3591229","type":"journal-article","created":{"date-parts":[[2023,6,6]],"date-time":"2023-06-06T20:06:24Z","timestamp":1686081984000},"page":"221-243","update-policy":"https:\/\/doi.org\/10.1145\/crossmark-policy","source":"Crossref","is-referenced-by-count":3,"title":["Garbage-Collection Safety for Region-Based Type-Polymorphic Programs"],"prefix":"10.1145","volume":"7","author":[{"ORCID":"https:\/\/orcid.org\/0000-0002-6061-5993","authenticated-orcid":false,"given":"Martin","family":"Elsman","sequence":"first","affiliation":[{"name":"University of Copenhagen, Denmark"}],"role":[{"vocabulary":"crossref","role":"author"}]}],"member":"320","published-online":{"date-parts":[[2023,6,6]]},"reference":[{"key":"e_1_2_2_1_1","doi-asserted-by":"publisher","DOI":"10.1145\/182409.182414"},{"key":"e_1_2_2_2_1","doi-asserted-by":"publisher","DOI":"10.1145\/207110.207137"},{"key":"e_1_2_2_3_1","doi-asserted-by":"publisher","DOI":"10.1145\/582419.582448"},{"key":"e_1_2_2_4_1","doi-asserted-by":"publisher","DOI":"10.1145\/1806651.1806655"},{"key":"e_1_2_2_5_1","doi-asserted-by":"publisher","DOI":"10.1007\/BF01811537"},{"key":"e_1_2_2_6_1","doi-asserted-by":"publisher","DOI":"10.1145\/237721.237771"},{"key":"e_1_2_2_7_1","volume-title":"Minimal Typing Derivations. In ACM SIGPLAN Workshop on ML and its Applications. 120\u2013126","author":"Bj\u00f8rner Nikolaj Skallerud","year":"1994","unstructured":"Nikolaj Skallerud Bj\u00f8rner . 1994 . Minimal Typing Derivations. In ACM SIGPLAN Workshop on ML and its Applications. 120\u2013126 . Nikolaj Skallerud Bj\u00f8rner. 1994. Minimal Typing Derivations. In ACM SIGPLAN Workshop on ML and its Applications. 120\u2013126."},{"key":"e_1_2_2_8_1","doi-asserted-by":"publisher","DOI":"10.1145\/268946.268949"},{"key":"e_1_2_2_9_1","doi-asserted-by":"publisher","DOI":"10.1145\/781131.781168"},{"key":"e_1_2_2_10_1","doi-asserted-by":"publisher","DOI":"10.1006\/inco.2001.3112"},{"key":"e_1_2_2_11_1","doi-asserted-by":"publisher","DOI":"10.1145\/158511.158611"},{"key":"e_1_2_2_12_1","doi-asserted-by":"publisher","DOI":"10.1007\/BFb0055516"},{"key":"e_1_2_2_13_1","doi-asserted-by":"publisher","DOI":"10.1145\/604174.604190"},{"key":"e_1_2_2_14_1","doi-asserted-by":"publisher","DOI":"10.5281\/zenodo.7803910"},{"key":"e_1_2_2_15_1","volume-title":"An Optimizing Backend for the ML Kit Using a Stack of Regions. Student Project 95-7-8","author":"Elsman Martin","unstructured":"Martin Elsman and Niels Hallenberg . 1995. An Optimizing Backend for the ML Kit Using a Stack of Regions. Student Project 95-7-8 , University of Copenhagen (DIKU) . Martin Elsman and Niels Hallenberg. 1995. An Optimizing Backend for the ML Kit Using a Stack of Regions. Student Project 95-7-8, University of Copenhagen (DIKU)."},{"key":"e_1_2_2_16_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-030-39197-3_7"},{"key":"e_1_2_2_17_1","doi-asserted-by":"publisher","DOI":"10.1017\/S0956796821000010"},{"key":"e_1_2_2_18_1","doi-asserted-by":"publisher","DOI":"10.1007\/11693024_2"},{"key":"e_1_2_2_19_1","doi-asserted-by":"publisher","DOI":"10.1017\/CBO9780511546846"},{"key":"e_1_2_2_20_1","doi-asserted-by":"publisher","DOI":"10.1145\/378795.378815"},{"key":"e_1_2_2_21_1","doi-asserted-by":"publisher","DOI":"10.1145\/113445.113460"},{"key":"e_1_2_2_22_1","doi-asserted-by":"publisher","DOI":"10.1145\/141471.141504"},{"key":"e_1_2_2_23_1","doi-asserted-by":"publisher","DOI":"10.1145\/512529.512547"},{"key":"e_1_2_2_24_1","doi-asserted-by":"publisher","DOI":"10.1002\/spe.4380100607"},{"key":"e_1_2_2_25_1","doi-asserted-by":"publisher","DOI":"10.1016\/S1571-0661(04)80870-3"},{"key":"e_1_2_2_26_1","doi-asserted-by":"publisher","DOI":"10.1145\/286860.286878"},{"key":"e_1_2_2_27_1","volume-title":"The Garbage Collection Handbook: The Art of Automatic Memory Management","author":"Jones Richard","unstructured":"Richard Jones , Antony Hosking , and Eliot Moss . 2011. The Garbage Collection Handbook: The Art of Automatic Memory Management . Chapman & Hall\/CRC. Richard Jones, Antony Hosking, and Eliot Moss. 2011. The Garbage Collection Handbook: The Art of Automatic Memory Management. Chapman & Hall\/CRC."},{"key":"e_1_2_2_28_1","doi-asserted-by":"publisher","DOI":"10.1145\/1706299.1706327"},{"key":"e_1_2_2_29_1","doi-asserted-by":"publisher","DOI":"10.1145\/3158154"},{"key":"e_1_2_2_30_1","doi-asserted-by":"publisher","DOI":"10.1145\/1993478.1993482"},{"key":"e_1_2_2_31_1","doi-asserted-by":"publisher","DOI":"10.1145\/1596550.1596563"},{"key":"e_1_2_2_32_1","doi-asserted-by":"publisher","DOI":"10.1016\/0022-0000(78)90014-4"},{"key":"e_1_2_2_33_1","volume-title":"Compiling with Types. Ph. D. Dissertation. School of Computer Science","author":"Morrisett Greg","unstructured":"Greg Morrisett . 1995. Compiling with Types. Ph. D. Dissertation. School of Computer Science , Carnegie Mellon University , Pittsburgh, PA 15213. Greg Morrisett. 1995. Compiling with Types. Ph. D. Dissertation. School of Computer Science, Carnegie Mellon University, Pittsburgh, PA 15213."},{"key":"e_1_2_2_34_1","doi-asserted-by":"publisher","DOI":"10.1145\/224164.224182"},{"key":"e_1_2_2_35_1","volume-title":"Workshop on Compiler Support for Systems Software","author":"Morrisett Greg","year":"1996","unstructured":"Greg Morrisett , David Tarditi , Perry Cheng , Chris Stone , Robert Harper , and Peter Lee . 1996 . The TIL\/ML Compiler: Performance and Safety through Types . In Workshop on Compiler Support for Systems Software , Tucson. Greg Morrisett, David Tarditi, Perry Cheng, Chris Stone, Robert Harper, and Peter Lee. 1996. The TIL\/ML Compiler: Performance and Safety through Types. In Workshop on Compiler Support for Systems Software, Tucson."},{"key":"e_1_2_2_36_1","unstructured":"John H. Reppy. 1994. A High-performance Garbage Collector for Standard ML. AT&T Bell Laboratories. John H. Reppy. 1994. A High-performance Garbage Collector for Standard ML. AT&T Bell Laboratories."},{"key":"e_1_2_2_37_1","volume-title":"Workshop on Implementation, Compilation, Optimization of Object-Oriented Languages, Programs and Systems.","author":"Salagnac Guillaume","year":"2006","unstructured":"Guillaume Salagnac , Chaker Nakhli , Christophe Rippert , and Sergio Yovine . 2006 . Efficient Region-Based Memory Management for Resource-limited Real-Time Embedded Systems .. In Workshop on Implementation, Compilation, Optimization of Object-Oriented Languages, Programs and Systems. Guillaume Salagnac, Chaker Nakhli, Christophe Rippert, and Sergio Yovine. 2006. Efficient Region-Based Memory Management for Resource-limited Real-Time Embedded Systems.. In Workshop on Implementation, Compilation, Optimization of Object-Oriented Languages, Programs and Systems."},{"key":"e_1_2_2_38_1","doi-asserted-by":"publisher","DOI":"10.1016\/j.entcs.2005.01.026"},{"key":"e_1_2_2_39_1","doi-asserted-by":"publisher","DOI":"10.1016\/j.scico.2006.02.003"},{"key":"e_1_2_2_40_1","doi-asserted-by":"publisher","DOI":"10.1145\/231379.231414"},{"key":"e_1_2_2_41_1","doi-asserted-by":"publisher","DOI":"10.1145\/291891.291894"},{"key":"e_1_2_2_42_1","doi-asserted-by":"crossref","unstructured":"Mads Tofte and Lars Birkedal. 2000. Unification and Polymorphism in Region Inference. Proof Language and Interaction. Essays in Honour of Robin Milner May (25 pages) Mads Tofte and Lars Birkedal. 2000. Unification and Polymorphism in Region Inference. Proof Language and Interaction. Essays in Honour of Robin Milner May (25 pages)","DOI":"10.7551\/mitpress\/5641.003.0020"},{"key":"e_1_2_2_43_1","doi-asserted-by":"publisher","DOI":"10.1023\/B:LISP.0000029446.78563.a4"},{"key":"e_1_2_2_44_1","volume-title":"Tommy H\u00f8jfeld Olesen, and Peter Sestoft","author":"Tofte Mads","year":"2022","unstructured":"Mads Tofte , Lars Birkedal , Martin Elsman , Niels Hallenberg , Tommy H\u00f8jfeld Olesen, and Peter Sestoft . 2022 . Programming with Regions in the MLKit (Revised for Version 4.7.2). Department of Computer Science, University of Copenhagen , Denmark. Mads Tofte, Lars Birkedal, Martin Elsman, Niels Hallenberg, Tommy H\u00f8jfeld Olesen, and Peter Sestoft. 2022. Programming with Regions in the MLKit (Revised for Version 4.7.2). Department of Computer Science, University of Copenhagen, Denmark."},{"key":"e_1_2_2_45_1","volume-title":"A Theory of Stack Allocation in Polymorphically Typed Languages. Department of Computer Science","author":"Tofte Mads","unstructured":"Mads Tofte and Jean-Pierre Talpin . 1993. A Theory of Stack Allocation in Polymorphically Typed Languages. Department of Computer Science , University of Copenhagen. Mads Tofte and Jean-Pierre Talpin. 1993. A Theory of Stack Allocation in Polymorphically Typed Languages. Department of Computer Science, University of Copenhagen."},{"key":"e_1_2_2_46_1","doi-asserted-by":"publisher","DOI":"10.1006\/inco.1996.2613"},{"key":"e_1_2_2_47_1","doi-asserted-by":"publisher","DOI":"10.1145\/182409.182411"},{"key":"e_1_2_2_48_1","doi-asserted-by":"publisher","DOI":"10.1145\/2951913.2951944"},{"key":"e_1_2_2_49_1","doi-asserted-by":"publisher","DOI":"10.1145\/1159876.1159877"},{"key":"e_1_2_2_50_1","doi-asserted-by":"publisher","DOI":"10.1006\/inco.1994.1093"}],"container-title":["Proceedings of the ACM on Programming Languages"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3591229","content-type":"unspecified","content-version":"vor","intended-application":"text-mining"},{"URL":"https:\/\/dl.acm.org\/doi\/pdf\/10.1145\/3591229","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2025,6,17]],"date-time":"2025-06-17T16:47:46Z","timestamp":1750178866000},"score":1,"resource":{"primary":{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3591229"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2023,6,6]]},"references-count":50,"journal-issue":{"issue":"PLDI","published-print":{"date-parts":[[2023,6,6]]}},"alternative-id":["10.1145\/3591229"],"URL":"https:\/\/doi.org\/10.1145\/3591229","relation":{},"ISSN":["2475-1421"],"issn-type":[{"value":"2475-1421","type":"electronic"}],"subject":[],"published":{"date-parts":[[2023,6,6]]},"assertion":[{"value":"2023-06-06","order":2,"name":"published","label":"Published","group":{"name":"publication_history","label":"Publication History"}}]}}