Compiler-enforced memory semantics in the SACLIB computer algebra library

  • Authors:
  • David G. Richardson;Werner Krandick

  • Affiliations:
  • Drexel University, Philadelphia, PA;Drexel University, Philadelphia, PA

  • Venue:
  • CASC'05 Proceedings of the 8th international conference on Computer Algebra in Scientific Computing
  • Year:
  • 2005

Quantified Score

Hi-index 0.00

Visualization

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.