plll  1.0
matrix-mem.hpp File Reference

Memory management for matrix and vector operations. More...

#include <cassert>
#include <cstddef>
#include <cstdlib>

Go to the source code of this file.

Classes

class  plll::linalg::storage_traits< T >
 Provides means to allocate, reallocate and release (linear) arrays of objects of type T. More...
 

Namespaces

 plll
 Contains the plll library.
 
 plll::linalg
 Contains the matrix and vector library as long as other linear algebra functionality.
 

Detailed Description

Memory management for matrix and vector operations.

This header provides memory management traits (plll::linalg::storage_traits<> template) for the matrix and vector templates in matrix.hpp.

Note that by modifying this header, one can switch between different memory managers for the default plll::linalg::storage_traits<> traits. One can choose between

  • a debug variant, which pads blocks of memory and periodically checks them if out-of-bound write accesses happened or if something was freed twice;
  • a failsafe variant, which uses no tricks and classical new and delete for memory management. Will call superfluous constructors and use operator= instead of copy-constructing;
  • the "release" mode variant, which is the default and should always be used except when debugging.

Definition in file matrix-mem.hpp.