Mercurial > hg > octave-terminal
changeset 8680:a2bcd96b9344
use allocators for idx_vector_rep subclasses
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Thu, 05 Feb 2009 14:34:30 +0100 |
parents | 280fae940bb0 |
children | 72b1f1eece70 |
files | liboctave/idx-vector.cc liboctave/idx-vector.h |
diffstat | 2 files changed, 17 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/idx-vector.cc +++ b/liboctave/idx-vector.cc @@ -60,6 +60,8 @@ ("internal error: idx_vector index out of range."); } +DEFINE_OCTAVE_ALLOCATOR(idx_vector::idx_colon_rep); + idx_vector::idx_colon_rep::idx_colon_rep (char c) { if (c != ':') @@ -88,6 +90,8 @@ return os << ":"; } +DEFINE_OCTAVE_ALLOCATOR(idx_vector::idx_range_rep); + idx_vector::idx_range_rep::idx_range_rep (octave_idx_type _start, octave_idx_type _limit, octave_idx_type _step) : start(_start), len (_step ? (_limit - _start) / _step : -1), step (_step) @@ -209,6 +213,8 @@ return convert_index (i, conv_error, ext); } +DEFINE_OCTAVE_ALLOCATOR(idx_vector::idx_scalar_rep); + template <class T> idx_vector::idx_scalar_rep::idx_scalar_rep (T x) { @@ -239,6 +245,8 @@ return os << data; } +DEFINE_OCTAVE_ALLOCATOR(idx_vector::idx_vector_rep); + template <class T> idx_vector::idx_vector_rep::idx_vector_rep (const Array<T>& nda) : data (0), len (nda.numel ()), ext (0), aowner (0), orig_dims (nda.dims ())
--- a/liboctave/idx-vector.h +++ b/liboctave/idx-vector.h @@ -31,6 +31,7 @@ #include "dim-vector.h" #include "oct-inttypes.h" +#include "oct-alloc.h" template<class T> class Array; template<class T> class Sparse; @@ -137,6 +138,8 @@ private: + DECLARE_OCTAVE_ALLOCATOR + // No copying! idx_colon_rep (const idx_colon_rep& idx); }; @@ -190,6 +193,8 @@ private: + DECLARE_OCTAVE_ALLOCATOR + // No copying! idx_range_rep (const idx_range_rep& idx); @@ -241,6 +246,8 @@ private: + DECLARE_OCTAVE_ALLOCATOR + // No copying! idx_scalar_rep (const idx_scalar_rep& idx); @@ -299,6 +306,8 @@ private: + DECLARE_OCTAVE_ALLOCATOR + // No copying! idx_vector_rep (const idx_vector_rep& idx);