# HG changeset patch # User jwe # Date 1074888276 0 # Node ID 14dc2267c343ea99dd09f8b4d7f22a1fb0d85689 # Parent fa612b2cbfe91c067a6a0d2145b957fc32b67d0c [project @ 2004-01-23 20:04:35 by jwe] diff -r fa612b2cbfe9 -r 14dc2267c343 ChangeLog --- a/ChangeLog Fri Jan 23 16:42:51 2004 +0000 +++ b/ChangeLog Fri Jan 23 20:04:36 2004 +0000 @@ -1,3 +1,9 @@ +2004-01-23 John W. Eaton + + * configure.in (AH_BOTTOM): + Define OCTAVE_LOCAL_BUFFER using vector instead of auto_ptr. + Suggested by Paul Thomas + 2004-01-22 John W. Eaton * octMakefile.in (maintainer-clean, distclean): diff -r fa612b2cbfe9 -r 14dc2267c343 configure.in --- a/configure.in Fri Jan 23 16:42:51 2004 +0000 +++ b/configure.in Fri Jan 23 20:04:36 2004 +0000 @@ -29,7 +29,7 @@ EXTERN_CXXFLAGS="$CXXFLAGS" AC_INIT -AC_REVISION($Revision: 1.442 $) +AC_REVISION($Revision: 1.443 $) AC_PREREQ(2.57) AC_CONFIG_SRCDIR([src/octave.cc]) AC_CONFIG_HEADER(config.h) @@ -1430,15 +1430,20 @@ #define OCTAVE_HAVE_SIG_JUMP #endif -/* Always use new, since we sometimes allocate large chunks of memory - and that can cause trouble due to stack size limits. +/* Always use vector, since we sometimes allocate large chunks + of memory and that can cause trouble due to stack size limits. + + Note that using auto_ptr is not appropriate because it uses delete, + not delete[] and we need the latter to properly handle arrays + allocated with new[size]. + #if defined (HAVE_DYNAMIC_AUTO_ARRAYS) #define OCTAVE_LOCAL_BUFFER(T, buf, size) \ T buf[size] #else */ #define OCTAVE_LOCAL_BUFFER(T, buf, size) \ - std::auto_ptr buf ## _auto_ptr (new T [size]); \ - T *buf = buf ## _auto_ptr.get () + std::vector buf ## _vector (size); \ + T *buf = &(buf ## _vector[0]) /* #endif */ #if defined (__DECCXX) diff -r fa612b2cbfe9 -r 14dc2267c343 liboctave/ChangeLog --- a/liboctave/ChangeLog Fri Jan 23 16:42:51 2004 +0000 +++ b/liboctave/ChangeLog Fri Jan 23 20:04:36 2004 +0000 @@ -1,5 +1,8 @@ 2004-01-23 John W. Eaton + * file-ops.cc: Include instead of for new + definition of OCTAVE_LOCAL_BUFFER. + * EIG.cc, EIG.h (EIG::init, EIG::symmetric_init, EIG::hermitian_init): New arg, calc_eigenvectors. * EIG.h (EIG:EIG): New optional arg, calc_eigenvectors. diff -r fa612b2cbfe9 -r 14dc2267c343 liboctave/file-ops.cc --- a/liboctave/file-ops.cc Fri Jan 23 16:42:51 2004 +0000 +++ b/liboctave/file-ops.cc Fri Jan 23 20:04:36 2004 +0000 @@ -30,7 +30,7 @@ #include #include -#include +#include #ifdef HAVE_SYS_TYPES_H #include diff -r fa612b2cbfe9 -r 14dc2267c343 src/ChangeLog --- a/src/ChangeLog Fri Jan 23 16:42:51 2004 +0000 +++ b/src/ChangeLog Fri Jan 23 20:04:36 2004 +0000 @@ -1,5 +1,12 @@ 2004-01-23 John W. Eaton + * ov-bool.cc, ov-cx-mat.cc, ov-re-mat.cc, ov-str-mat.cc: + Include . + * file-io.cc, ls-hdf5.cc, ls-mat4.cc, ls-mat5.cc, ls-oct-binary.cc: + Include , not for new defn of OCTAVE_LOCAL_BUFFER. + * load-save.cc, ls-mat-ascii.cc, ls-oct-ascii.cc + No need to include now. + * DLD-FUNCTIONS/eig.cc (Feig): Use new optional arg for EIG to avoid computing eigenvectors if not requested. Based on a patch from David Bateman . diff -r fa612b2cbfe9 -r 14dc2267c343 src/file-io.cc --- a/src/file-io.cc Fri Jan 23 16:42:51 2004 +0000 +++ b/src/file-io.cc Fri Jan 23 20:04:36 2004 +0000 @@ -42,7 +42,7 @@ #include #include -#include +#include #ifdef HAVE_UNISTD_H #ifdef HAVE_SYS_TYPES_H diff -r fa612b2cbfe9 -r 14dc2267c343 src/load-save.cc --- a/src/load-save.cc Fri Jan 23 16:42:51 2004 +0000 +++ b/src/load-save.cc Fri Jan 23 20:04:36 2004 +0000 @@ -35,7 +35,6 @@ #include #include #include -#include #include #ifdef HAVE_HDF5 diff -r fa612b2cbfe9 -r 14dc2267c343 src/ls-hdf5.cc --- a/src/ls-hdf5.cc Fri Jan 23 16:42:51 2004 +0000 +++ b/src/ls-hdf5.cc Fri Jan 23 20:04:36 2004 +0000 @@ -35,8 +35,8 @@ #include #include #include -#include #include +#include #include diff -r fa612b2cbfe9 -r 14dc2267c343 src/ls-mat-ascii.cc --- a/src/ls-mat-ascii.cc Fri Jan 23 16:42:51 2004 +0000 +++ b/src/ls-mat-ascii.cc Fri Jan 23 20:04:36 2004 +0000 @@ -31,7 +31,6 @@ #include #include #include -#include #include #include "byte-swap.h" diff -r fa612b2cbfe9 -r 14dc2267c343 src/ls-mat4.cc --- a/src/ls-mat4.cc Fri Jan 23 16:42:51 2004 +0000 +++ b/src/ls-mat4.cc Fri Jan 23 20:04:36 2004 +0000 @@ -31,8 +31,8 @@ #include #include #include -#include #include +#include #include "byte-swap.h" #include "data-conv.h" diff -r fa612b2cbfe9 -r 14dc2267c343 src/ls-mat5.cc --- a/src/ls-mat5.cc Fri Jan 23 16:42:51 2004 +0000 +++ b/src/ls-mat5.cc Fri Jan 23 20:04:36 2004 +0000 @@ -33,8 +33,8 @@ #include #include #include -#include #include +#include #include "byte-swap.h" #include "data-conv.h" diff -r fa612b2cbfe9 -r 14dc2267c343 src/ls-oct-ascii.cc --- a/src/ls-oct-ascii.cc Fri Jan 23 16:42:51 2004 +0000 +++ b/src/ls-oct-ascii.cc Fri Jan 23 20:04:36 2004 +0000 @@ -32,7 +32,6 @@ #include #include #include -#include #include #include "byte-swap.h" diff -r fa612b2cbfe9 -r 14dc2267c343 src/ls-oct-binary.cc --- a/src/ls-oct-binary.cc Fri Jan 23 16:42:51 2004 +0000 +++ b/src/ls-oct-binary.cc Fri Jan 23 20:04:36 2004 +0000 @@ -31,8 +31,8 @@ #include #include #include -#include #include +#include #include "byte-swap.h" #include "data-conv.h" diff -r fa612b2cbfe9 -r 14dc2267c343 src/ov-bool-mat.cc --- a/src/ov-bool-mat.cc Fri Jan 23 16:42:51 2004 +0000 +++ b/src/ov-bool-mat.cc Fri Jan 23 20:04:36 2004 +0000 @@ -29,6 +29,7 @@ #endif #include +#include #include "lo-ieee.h" #include "mx-base.h" diff -r fa612b2cbfe9 -r 14dc2267c343 src/ov-cx-mat.cc --- a/src/ov-cx-mat.cc Fri Jan 23 16:42:51 2004 +0000 +++ b/src/ov-cx-mat.cc Fri Jan 23 20:04:36 2004 +0000 @@ -29,6 +29,7 @@ #endif #include +#include #include "lo-ieee.h" #include "mx-base.h" diff -r fa612b2cbfe9 -r 14dc2267c343 src/ov-re-mat.cc --- a/src/ov-re-mat.cc Fri Jan 23 16:42:51 2004 +0000 +++ b/src/ov-re-mat.cc Fri Jan 23 20:04:36 2004 +0000 @@ -31,6 +31,7 @@ #include #include +#include #include "lo-ieee.h" #include "lo-utils.h" diff -r fa612b2cbfe9 -r 14dc2267c343 src/ov-str-mat.cc --- a/src/ov-str-mat.cc Fri Jan 23 16:42:51 2004 +0000 +++ b/src/ov-str-mat.cc Fri Jan 23 20:04:36 2004 +0000 @@ -29,6 +29,7 @@ #endif #include +#include #include "lo-ieee.h" #include "mx-base.h"