Mercurial > hg > octave-terminal
changeset 4382:f8373733d8f9
[project @ 2003-04-22 18:02:48 by jwe]
author | jwe |
---|---|
date | Tue, 22 Apr 2003 18:02:48 +0000 |
parents | c77614c1c611 |
children | 26f74e9fd8a5 |
files | ChangeLog configure.in src/ChangeLog src/load-save.cc |
diffstat | 4 files changed, 11 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2003-04-22 John W. Eaton <jwe@bevo.che.wisc.edu> + + * configure.in (OCTAVE_LOCAL_BUFFER): Always allocate temporary + buffer using new. + 2003-04-18 John W. Eaton <jwe@bevo.che.wisc.edu> * Makefile.in octMakefile.in: Delete kpathsea targets.
--- a/configure.in +++ b/configure.in @@ -22,7 +22,7 @@ ### 02111-1307, USA. AC_INIT -AC_REVISION($Revision: 1.424 $) +AC_REVISION($Revision: 1.425 $) AC_PREREQ(2.52) AC_CONFIG_SRCDIR([src/octave.cc]) AC_CONFIG_HEADER(config.h) @@ -1389,14 +1389,16 @@ #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. #if defined (HAVE_DYNAMIC_AUTO_ARRAYS) #define OCTAVE_LOCAL_BUFFER(T, buf, size) \ T buf[size] -#else +#else */ #define OCTAVE_LOCAL_BUFFER(T, buf, size) \ std::auto_ptr<T> buf ## _auto_ptr (new T [size]); \ T *buf = buf ## _auto_ptr.get () -#endif +/* #endif */ #if defined (__DECCXX) #define __USE_STD_IOSTREAM
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,8 +1,3 @@ -2003-04-22 John W. Eaton <jwe@bevo.che.wisc.edu> - - * load-save.cc (MAT5_DO_WRITE): Always allocate temporary buffer - using new. - 2003-04-18 John W. Eaton <jwe@bevo.che.wisc.edu> * toplev.cc (octave_config_info): Delete LIBKPATHSEA from struct.
--- a/src/load-save.cc +++ b/src/load-save.cc @@ -4095,8 +4095,7 @@ #define MAT5_DO_WRITE(TYPE, data, count, stream) \ do \ { \ - std::auto_ptr<TYPE> tmp_auto_ptr (new TYPE [count]); \ - TYPE *ptr = tmp_auto_ptr.get (); \ + OCTAVE_LOCAL_BUFFER (TYPE, ptr, count); \ for (int i = 0; i < count; i++) \ ptr[i] = X_CAST (TYPE, data[i]); \ stream.write (X_CAST (char *, ptr), count * sizeof (TYPE)); \