Mercurial > octave
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 Tue Apr 22 16:57:29 2003 +0000 +++ b/ChangeLog Tue Apr 22 18:02:48 2003 +0000 @@ -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 Tue Apr 22 16:57:29 2003 +0000 +++ b/configure.in Tue Apr 22 18:02:48 2003 +0000 @@ -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 Tue Apr 22 16:57:29 2003 +0000 +++ b/src/ChangeLog Tue Apr 22 18:02:48 2003 +0000 @@ -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 Tue Apr 22 16:57:29 2003 +0000 +++ b/src/load-save.cc Tue Apr 22 18:02:48 2003 +0000 @@ -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)); \