skip to main content
10.1145/512529.512563acmconferencesArticle/Chapter ViewAbstractPublication PagespldiConference Proceedingsconference-collections
Article

Region-based memory management in cyclone

Published:17 May 2002Publication History

ABSTRACT

Cyclone is a type-safe programming language derived from C. The primary design goal of Cyclone is to let programmers control data representation and memory management without sacrificing type-safety. In this paper, we focus on the region-based memory management of Cyclone and its static typing discipline. The design incorporates several advancements, including support for region subtyping and a coherent integration with stack allocation and a garbage collector. To support separate compilation, Cyclone requires programmers to write some explicit region annotations, but a combination of default annotations, local type inference, and a novel treatment of region effects reduces this burden. As a result, we integrate C idioms in a region-based framework. In our experience, porting legacy C to Cyclone has required altering about 8% of the code; of the changes, only 6% (of the 8%) were region annotations.

References

  1. A. Aiken, M. Fähndrich, and R. Levien. Better static memory management: Improving region-based analysis of higher-order languages. In ACM Conference on Programming Language Design and Implementation, pages 174--185, La Jolla, CA, 1995 Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. T. M. Austin, S. E. Breach, and G. S. Sohi. Efficient detection of all pointer and array access errors. In ACM Conference on Programming Language Design and Implementation, pages 290--301, Orlando, FL, June 1994 Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. T. Ball and S. K. Rajamani. Automatically validating temporal safety properties of interfaces. In SPIN 2001, Workshop on Model Checking of Software, volume 2057 of Lecture Notes in Computer Science, pages 103--122, Toronto, Canada, May 2001. Springer-Verlag Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. H.-J. Boehm and M. Weiser. Garbage collection in an uncooperative environment. Software Practice and Experience, 18(9):807--820, 1988 Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. K. B. Bruce, L. Cardelli, and B. C. Pierce. Comparing object encodings. Information and Computation, 155:108--133, 1999 Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Cyclone user's manual. Technical Report 2001-1855, Department of Computer Science, Cornell University, Nov. 2001. Current version at http://www.cs.cornell.edu/projects/cyclone/Google ScholarGoogle Scholar
  7. R. DeLine and M. Fähndrich. Enforcing high-level protocols in low-level software. In ACM Conference on Programming Language Design and Implementation, pages 59--69, Snowbird, UT, June 2001 Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. T. Dowd, F. Henderson, and P. Ross. Compiling Mercury to the .NET common language runtime. In N. Benton and A. Kennedy, editors, BABEL'01: First International Workshop on Multi-Language Infrastructure and Interoperability, volume 59.1 of Electronic Notes in Theoretical Computer Science, Florence, Italy, Sept. 2001Google ScholarGoogle Scholar
  9. D. Evans. LCLint user's guide. http://lclint.cs.virginia.edu/guide/Google ScholarGoogle Scholar
  10. D. Evans. Static detection of dynamic memory errors. In ACM Conference on Programming Language Design and Implementation, pages 44--53, Philadelphia, PA, May 1996 Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. D. Gay and A. Aiken. Memory management with explicit regions. In ACM Conference on Programming Language Design and Implementation, pages 313--323, Montreal, Canada, June 1998 Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. D. Gay and A. Aiken. Language support for regions. In ACM Conference on Programming Language Design and Implementation, pages 70--80, Snowbird, UT, June 2001 Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. A. D. Gordon and D. Syme. Typing a multi-language intermediate code. In Twenty-Eighth ACM Symposium on Principles of Programming Languages, pages 248--260, London, United Kingdom, Jan. 2001 Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. D. Grossman. Existential types for imperative languages. In Eleventh European Symposium on Programming, pages 21--35, Grenoble, France, Apr. 2002 Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. D. Grossman, G. Morrisett, Y. Wang, T. Jim, M. Hicks, and J. Cheney. Formal type soundness for Cyclone's region system. Technical Report 2001-1856, Department of Computer Science, Cornell University, Nov. 2001 Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. N. Hallenberg, M. Elsman, and M. Tofte. Combining region inference and garbage collection. In ACM Conference on Programming Language Design and Implementation, Berlin, Germany, June 2002. This volume Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. F. Henglein, H. Makholm, and H. Niss. A direct approach to control-flow sensitive region-based memory management. In Third International Conference on Principles and Practice of Declarative Programming, Florence, Italy, Sept. 2001 Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. R. Jain. The Art of Computer Systems Performance Analysis. Wiley, 1991Google ScholarGoogle Scholar
  19. T. Jim, G. Morrisett, D. Grossman, M. Hicks, J. Cheney, and Y. Wang. Cyclone: A safe dialect of C. In USENIX Annual Technical Conference, Monterey, CA, June 2002 Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. G. McGary. Bounds checking projects. http://www.gnu.org/software/gcc/projects/bp/main.htmlGoogle ScholarGoogle Scholar
  21. Y. Minamide, G. Morrisett, and R. Harper. Typed closure conversion. In Twenty-Third ACM Symposium on Principles of Programming Languages, pages 271--283, St. Petersburg, FL, Jan. 1996 Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. J. Mitchell and G. Plotkin. Abstract types have existential type. ACM Transactions on Progamming Languages and Systems, 10(3):470--502, 1988. Preliminary version in Twelfth ACM Symposium on Principles of Programming Languages, 1985 Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. S. Monnier, B. Saha, and Z. Shao. Principled scavenging. In ACM Conference on Programming Language Design and Implementation, pages 81--91, Snowbird, UT, June 2001 Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. G. Morrisett, K. Crary, N. Glew, and D. Walker. Stack-based typed assembly language. In Workshop on Types in Compilation, volume 1473 of Lecture Notes in Computer Science, pages 28--52, Kyoto, Japan, Mar. 1998. Springer-Verlag Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. G. C. Necula, S. McPeak, and W. Weimer. CCured: Type-safe retrofitting of legacy code. In Twenty-Ninth ACM Symposium on Principles of Programming Languages, pages 128--139, Portland, OR, Jan. 2002 Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. M. Tofte and L. Birkedal. A region inference algorithm. ACM Transactions on Progamming Languages and Systems, 20(4):734--767, July 1998 Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. M. Tofte, L. Birkedal, M. Elsman, N. Hallenberg, T. H. Olesen, and P. Sestoft. Programming with regions in the ML Kit (for version 4). Technical report, IT University of Copenhagen, Sept. 2001Google ScholarGoogle Scholar
  28. M. Tofte and J.-P. Talpin. Region-based memory management. Information and Computation, 132(2):109--176, 1997 Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. D. Walker, K. Crary, and G. Morrisett. Typed memory management in a calculus of capabilities. ACM Transactions on Progamming Languages and Systems, 24(4):701--771, July 2000 Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. D. Walker and K. Watkins. On regions and linear types. In Sixth ACM International Conference on Functional Programming, pages 181--192, Florence, Italy, Sept. 2001 Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. D. C. Wang and A. W. Appel. Type-preserving garbage collectors. In Twenty-Eighth ACM Symposium on Principles of Programming Languages, pages 166--178, London, United Kingdom, Jan. 2001 Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. H. Xi. Imperative programming with dependent types. In Fifteenth IEEE Symposium on Logic in Computer Science, pages 375--387, Santa Barbara, CA, June 2000 Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. H. Xi and F. Pfenning. Dependent types in practical programming. In Twenty-Sixth ACM Symposium on Principles of Programming Languages, pages 214--227, San Antonio, TX, Jan. 1999 Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Region-based memory management in cyclone

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in
      • Published in

        cover image ACM Conferences
        PLDI '02: Proceedings of the ACM SIGPLAN 2002 conference on Programming language design and implementation
        June 2002
        338 pages
        ISBN:1581134630
        DOI:10.1145/512529

        Copyright © 2002 ACM

        Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 17 May 2002

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • Article

        Acceptance Rates

        PLDI '02 Paper Acceptance Rate28of169submissions,17%Overall Acceptance Rate406of2,067submissions,20%

        Upcoming Conference

        PLDI '24

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader