Abstract
We present a memory management subsystem for the computer algebra library SACLIB that removes the potential for memory leaks or double deletes in applications using the system. The system encapsulates the management of arrays that are allocated on the heap or on the system stack. The system makes arrays responsible for their own memory management, and enables the compiler to prevent other parts of SACLIB from managing array memory. To prove that our memory module and all applications using it are leak free and double delete free we introduce a new iterator concept and implement a model of that concept using generic programming techniques such as template meta-programming. Our innovations reduce the amount of code responsible for array memory management from 10,000 lines of code to 2,000 lines of code. Using hardware performance counters we show optimizing compilers are capable of avoiding any runtime overhead.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Collins, G.E., et al.: SACLIB User’s Guide. Technical Report 93-19, Research Institute for Symbolic Computation, RISC-Linz, Johannes Kepler University, A-4040 Linz, Austria (1993)
Hong, H., Neubacher, A., Schreiner, W.: The design of the SACLIB/PACLIB kernels. Journal of Symbolic Computation 19, 111–132 (1995)
Collins, G.E., Hong, H.: Partial CAD contruction in quantifier elimination. Technical Report OSU-CISRC-10/89 TR45, Computer Science Department, Ohio State University (1989)
Hong, H.: An improvement of the projection operator in cylindrical algebraic decomposition. In: Proceedings of the International Symposium on Symbolic and Algebraic Computation, pp. 261–264. ACM Press, New York (1990)
Hong, H., Liska, R., Steinberg, S.: Testing stability by quantifier elimination. Journal of Symbolic Computation 24, 161–187 (1997)
Brown, C.W.: QEPCAD B: A program for computing with semi-algebraic sets using CADs. SIGSAM Bulletin 37, 97–108 (2003)
Brown, C.W.: QEPCAD B: A system for computing with semi-algebraic sets via cylindrical algebraic decomposition. SIGSAM Bulletin 38, 23–24 (2004)
Krandick, W., Mehlhorn, K.: New bounds for the Descartes method. Journal of Symbolic Computation (to appear)
Valgrind Developers: Valgrind, http://valgrind.kde.org
Electric Fence Developers: Electric Fence, http://www.pf-lug.de/projekte/haya/efence.php
IBM Corporation: Rational Purify, http://www-306.ibm.com/software/awdtools/purify/
Alexandrescu, A.: Modern C++ Design. Addison Wesley Longman, Inc., Amsterdam (2001)
Abrahams, D., Gurtovoy, A.: C++ Template Metaprogramming. Addison Wesley Longman, Inc., Amsterdam (2005)
Vandevoorde, D., Josuttis, N.M.: C++ Templates. Addison Wesley Longman, Inc. (2003)
Musser, D., Schupp, S., Loos, R.: Requirement oriented programming concepts, implications, and algorithms. In: [14], pp. 12–24
Musser, D.R., Shao, Z.: Concept use or concept refinement: An important distinction in building generic specifications. In: George, C.W., Miao, H. (eds.) ICFEM 2002. LNCS, vol. 2495, pp. 132–143. Springer, Heidelberg (2002)
Schupp, S., Loos, R.: SuchThat—Generic programming works. In: [42], pp. 133–145
Gregor, D., Schupp, S., Musser, D.: Design patterns for library optimizations. Scientific Programming 11, 309–320 (2003)
Schupp, S., Gregor, D., Musser, D., Liu, S.: Semantic and behavioral library transformations. Information and Software Technology 44, 797–810 (2002)
Schreiner, W., Danielczyk-Landerl, W., Marin, M., Stöcher, W.: A generic programming environment for high-performance mathematical libraries. In: [42], pp. 256–267
International Standards Organization: ISO/IEC 14882:2003: Programming languages—C++ (2003), http://www.iso.org
Stroustrup, B.: The C++ Standard: Incorporating Technical Corrigendum No. 1. John Wiley and Sons, Chichester (2003)
Josuttis, N.M.: The C++ Standard Library. Addison Wesley Longman, Inc., Amsterdam (1999)
Kernighan, B.W., Ritchie, D.M.: The C Programming Language, 1st edn. Prentice-Hall, Englewood Cliffs (1978)
Innovative Computing Laboratory: PAPI, http://icl.cs.utk.edu/PAPI
Sutter, H.: Exceptional C++. Addison Wesley Longman, Inc., Amsterdam (1999)
Parnas, D.: On the criteria to be used in decomposing systems into modules. Communications of the ACM 5, 1053–1058 (1972)
Sutter, H.: More Exceptional C++. Addison Wesley Longman, Inc., Amsterdam (2001)
Meyers, S.: Effective STL. Addison Wesley Longman, Inc., Amsterdam (2001)
Meyers, S.: Effective C++, 2nd edn. Addison Wesley Longman, Inc., Amsterdam (1997)
Stroustrup, B.: The C++ Programming Language (Special Edition). Addison-Wesley, Reading (2000)
Stroustrup, B.: The Design and Evolution of C++. Addison-Wesley, Reading (1994)
Austern, M.H.: Generic Programming and the STL. Addison Wesley Longman, Inc., Amsterdam (1998)
Boost: Boost libraries and documentation, http://www.boost.org
Veldhuizen, T.L.: Arrays in blitz++. In: Caromel, D., Oldehoeft, R.R., Tholburn, M. (eds.) ISCOPE 1998. LNCS, vol. 1505, pp. 223–230. Springer, Heidelberg (1998)
Czarnecki, K., Eisenecker, U., Glück, R., Vandevoorde, D., Veldhuizen, T.: Generative programming and active libraries. In: [42], pp. 25–39
Czarnecki, K., Eisenecker, U.: Generative Programming: Methods, Tools, and Applications. Addison-Wesley Professional, Reading (2000)
GNU: The GNU Compiler Collection, http://gcc.gnu.org/
Intel Corporation: The Intel C++ Compiler, http://www.intel.com/software/products/compilers/clin/
International Standards Organization: ISO/IEC 9899:1999: Programming languages—C (1999), http://www.iso.org
British, S.I.: The C Standard: Incorporating Technical Corrigendum 1. John Wiley and Sons, Chichester (2002)
Jazayeri, M., Musser, D.R., Loos, R.G.K. (eds.): Generic Programming: International Seminar on Generic Programming. LNCS, vol. 1766. Springer, Heidelberg (2000)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2005 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Richardson, D.G., Krandick, W. (2005). Compiler-Enforced Memory Semantics in the SACLIB Computer Algebra Library. In: Ganzha, V.G., Mayr, E.W., Vorozhtsov, E.V. (eds) Computer Algebra in Scientific Computing. CASC 2005. Lecture Notes in Computer Science, vol 3718. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11555964_28
Download citation
DOI: https://doi.org/10.1007/11555964_28
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-28966-1
Online ISBN: 978-3-540-32070-8
eBook Packages: Computer ScienceComputer Science (R0)