Abstract
We present a method for reversible dynamic memory management based on a reversible version of the Buddy Memory system. This method supports decoupled allocation and deallocation of variable-sized records and can be applied to any reversible language with heap storage. We demonstrate how these new capabilities allow for the direct realization of commonplace data structures such as trees, heaps and queues which until now has not been practical in a reversible language. Finally, we provide a definition of our method in the high-level reversible language Janus as well as a description of its fragmentation and garbage-generation characteristics. The reversible memory management system has been fully implemented and tested in a compiler for a reversible object-oriented programming language targeting the reversible assembly language PISA.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
Notes
- 1.
Source code available at: https://github.com/cservenka/ROOPLPPC.
- 2.
- 3.
We have rehosted PendVM at https://github.com/TueHaulund/PendVM.
References
Axelsen, H.B., Glück, R.: Reversible representation and manipulation of constructor terms in the heap. In: Dueck, G.W., Miller, D.M. (eds.) RC 2013. LNCS, vol. 7948, pp. 96–109. Springer, Heidelberg (2013). https://doi.org/10.1007/978-3-642-38986-3_9
Brodal, G.S., Demaine, E.D., Munro, J.I.: Fast allocation and deallocation with an improved buddy system. Acta Informatica 41(4–5), 273–291 (2005)
Cservenka, M.H.: Design and Implementation of Dynamic Memory Management in a Reversible Object-Oriented Programming Language. Master’s thesis, University of Copenhagen, DIKU (2018). http://arxiv.org/abs/1804.05097
Dahl, O.J., Nygaard, K.: SIMULA: an ALGOL-based simulation language. Commun. ACM 9(9), 671–678 (1966)
Evans, J.: A scalable concurrent malloc(3) implementation for FreeBSD. In: BSDCan Conference, University of Ottawa (2006)
Frank, M.P.: Reversibility for Efficient Computing. Ph.D. thesis, Massachusetts Institute of Technology (1999)
Glück, R., Yokoyama, T.: A minimalist’s reversible while language. IEICE Trans. 100-D(5), 1026–1034 (2017)
Glück, R., Yokoyama, T.: A linear-time self-interpreter of a reversible imperative language. Comput. Softw. 33(3), 108–128 (2016)
Haulund, T.: Design and Implementation of a Reversible Object-Oriented Programming Language. Master’s thesis, University of Copenhagen, DIKU (2016). http://arxiv.org/abs/1707.07845
Haulund, T., Mogensen, T.Æ., Glück, R.: Implementing reversible object-oriented language features on reversible machines. In: Phillips, I., Rahaman, H. (eds.) RC 2017. LNCS, vol. 10301, pp. 66–73. Springer, Cham (2017). https://doi.org/10.1007/978-3-319-59936-6_5
Knowlton, K.C.: A fast storage allocator. Commun. ACM 8(10), 623–625 (1965)
Knuth, D.E.: The Art of Computer Programming: Fundamental Algorithms, vol. 1. Addison-Wesley, Boston (1998)
Mogensen, T.Æ.: Reference counting for reversible languages. In: Yamashita, S., Minato, S. (eds.) RC 2014. LNCS, vol. 8507, pp. 82–94. Springer, Cham (2014). https://doi.org/10.1007/978-3-319-08494-7_7
Mogensen, T.Æ.: Garbage collection for reversible functional languages. In: Krivine, J., Stefani, J.-B. (eds.) RC 2015. LNCS, vol. 9138, pp. 79–94. Springer, Cham (2015). https://doi.org/10.1007/978-3-319-20860-2_5
Schultz, U.P., Axelsen, H.B.: Elements of a reversible object-oriented language. In: Devitt, S., Lanese, I. (eds.) RC 2016. LNCS, vol. 9720, pp. 153–159. Springer, Cham (2016). https://doi.org/10.1007/978-3-319-40578-0_10
Vieri, C.J.: Pendulum: A Reversible Computer Architecture. Master’s thesis, University of California at Berkeley (1993)
Yokoyama, T., Axelsen, H.B., Glück, R.: Principles of a reversible programming language. In: Ramírez, A., Bilardi, G., Gschwind, M. (eds.) Computing Frontiers. Proceedings, pp. 43–54. ACM (2008)
Yokoyama, T., Axelsen, H.B., Glück, R.: Towards a reversible functional language. In: De Vos, A., Wille, R. (eds.) RC 2011. LNCS, vol. 7165, pp. 14–29. Springer, Heidelberg (2012). https://doi.org/10.1007/978-3-642-29517-1_2
Yokoyama, T., Glück, R.: A reversible programming language and its invertible self-interpreter. In: Ramalingam, G., Visser, E. (eds.) Partial Evaluation and Semantics-based Program Manipulation, pp. 144–153. ACM (2007)
Acknowledgments
The authors would like to thank the European COST Action IC 1405 “Reversible Computation” for its valuable support, Ulrik Pagh Schultz and the anonymous reviewers for their insightful comments.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2018 Springer Nature Switzerland AG
About this paper
Cite this paper
Cservenka, M.H., Glück, R., Haulund, T., Mogensen, T.Æ. (2018). Data Structures and Dynamic Memory Management in Reversible Languages. In: Kari, J., Ulidowski, I. (eds) Reversible Computation. RC 2018. Lecture Notes in Computer Science(), vol 11106. Springer, Cham. https://doi.org/10.1007/978-3-319-99498-7_19
Download citation
DOI: https://doi.org/10.1007/978-3-319-99498-7_19
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-99497-0
Online ISBN: 978-3-319-99498-7
eBook Packages: Computer ScienceComputer Science (R0)