changeset 8377:25bc2d31e1bf

improve OCTAVE_LOCAL_BUFFER
author Jaroslav Hajek <highegg@gmail.com>
date Wed, 29 Oct 2008 16:52:10 +0100
parents c43481a19bfe
children 7d0492aa522d
files ChangeLog configure.in liboctave/Array-d.cc liboctave/Array-f.cc liboctave/Array.cc liboctave/CMatrix.cc liboctave/CNDArray.cc liboctave/CSparse.cc liboctave/ChangeLog liboctave/CmplxCHOL.cc liboctave/CmplxGEPBAL.cc liboctave/MatrixType.cc liboctave/Sparse-op-defs.h liboctave/Sparse.cc liboctave/SparseCmplxLU.cc liboctave/SparseCmplxQR.cc liboctave/SparseQR.cc liboctave/SparsedbleLU.cc liboctave/dMatrix.cc liboctave/dNDArray.cc liboctave/dSparse.cc liboctave/data-conv.cc liboctave/dbleCHOL.cc liboctave/dbleGEPBAL.cc liboctave/fCMatrix.cc liboctave/fCNDArray.cc liboctave/fCmplxCHOL.cc liboctave/fCmplxGEPBAL.cc liboctave/fMatrix.cc liboctave/fNDArray.cc liboctave/file-ops.cc liboctave/floatCHOL.cc liboctave/floatGEPBAL.cc liboctave/lo-sysdep.cc liboctave/oct-fftw.cc liboctave/oct-locbuf.h liboctave/oct-md5.cc liboctave/oct-rand.cc liboctave/regex-match.cc liboctave/sparse-dmsolve.cc src/ChangeLog src/DLD-FUNCTIONS/__lin_interpn__.cc src/DLD-FUNCTIONS/amd.cc src/DLD-FUNCTIONS/ccolamd.cc src/DLD-FUNCTIONS/cellfun.cc src/DLD-FUNCTIONS/colamd.cc src/DLD-FUNCTIONS/gcd.cc src/DLD-FUNCTIONS/matrix_type.cc src/DLD-FUNCTIONS/regexp.cc src/DLD-FUNCTIONS/symbfact.cc src/DLD-FUNCTIONS/symrcm.cc src/file-io.cc src/gl-render.cc src/load-save.cc src/ls-hdf5.cc src/ls-mat4.cc src/ls-mat5.cc src/ls-oct-binary.cc src/mex.cc src/oct.h src/ov-base-int.cc src/ov-bool-mat.cc src/ov-bool-sparse.cc src/ov-cell.cc src/ov-class.cc src/ov-cx-mat.cc src/ov-cx-sparse.cc src/ov-fcn-handle.cc src/ov-fcn-inline.cc src/ov-flt-cx-mat.cc src/ov-flt-re-mat.cc src/ov-re-mat.cc src/ov-re-sparse.cc src/ov-str-mat.cc src/ov-struct.cc src/toplev.cc
diffstat 76 files changed, 184 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Dec 05 12:51:48 2008 +0100
+++ b/ChangeLog	Wed Oct 29 16:52:10 2008 +0100
@@ -1,3 +1,8 @@
+2008-10-29  Jaroslav Hajek  <highegg@gmail.com>
+
+	* configure.in: Remove the OCTAVE_LOCAL_BUFFER stuff (moved to
+	liboctave).
+
 2008-12-04  Jaroslav Hajek  <highegg@gmail.com>
 
 	* NEWS: Document more new features.
--- a/configure.in	Fri Dec 05 12:51:48 2008 +0100
+++ b/configure.in	Wed Oct 29 16:52:10 2008 +0100
@@ -1932,32 +1932,6 @@
 #define OCTAVE_HAVE_SIG_JUMP
 #endif
 
-/* Always use vector<T>, 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].
-
-   Use < T > instead of <T> to avoid problems if T is a template type
-   (say, foo<int>) and the preprocessor fails to insert a space and
-   generates <foo<int>>.
-
-#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::vector< T > buf ## _vector (size); \
-  T *buf = ((size) > 0 ? &(buf ## _vector[0]) : 0)
-
-/* #endif */
-
 #if defined (__DECCXX)
 #define __USE_STD_IOSTREAM
 #endif
--- a/liboctave/Array-d.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/liboctave/Array-d.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -30,6 +30,7 @@
 #include "Array.h"
 #include "Array.cc"
 #include "oct-sort.cc"
+#include "oct-locbuf.h"
 
 #if defined (HAVE_IEEE754_DATA_FORMAT)
 
--- a/liboctave/Array-f.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/liboctave/Array-f.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -30,6 +30,7 @@
 #include "Array.h"
 #include "Array.cc"
 #include "oct-sort.cc"
+#include "oct-locbuf.h"
 
 #if defined (HAVE_IEEE754_DATA_FORMAT)
 
--- a/liboctave/Array.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/liboctave/Array.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -40,6 +40,7 @@
 #include "Array-util.h"
 #include "idx-vector.h"
 #include "lo-error.h"
+#include "oct-locbuf.h"
 
 // One dimensional array class.  Handles the reference counting for
 // all the derived classes.
--- a/liboctave/CMatrix.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/liboctave/CMatrix.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -47,6 +47,7 @@
 #include "f77-fcn.h"
 #include "functor.h"
 #include "lo-error.h"
+#include "oct-locbuf.h"
 #include "lo-ieee.h"
 #include "lo-mappers.h"
 #include "lo-utils.h"
--- a/liboctave/CNDArray.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/liboctave/CNDArray.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -36,6 +36,7 @@
 #include "functor.h"
 #include "lo-ieee.h"
 #include "lo-mappers.h"
+#include "oct-locbuf.h"
 
 #if defined (HAVE_FFTW3)
 #include "oct-fftw.h"
--- a/liboctave/CSparse.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/liboctave/CSparse.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -35,6 +35,7 @@
 #include "lo-mappers.h"
 #include "f77-fcn.h"
 #include "dRowVector.h"
+#include "oct-locbuf.h"
 
 #include "CSparse.h"
 #include "boolSparse.h"
--- a/liboctave/ChangeLog	Fri Dec 05 12:51:48 2008 +0100
+++ b/liboctave/ChangeLog	Wed Oct 29 16:52:10 2008 +0100
@@ -1,3 +1,15 @@
+2008-10-29  Jaroslav Hajek  <highegg@gmail.com>
+
+	* oct-locbuf.h: New header file.
+	* Array-d.cc, Array-f.cc, Array.cc, CMatrix.cc, CNDArray.cc,
+	CSparse.cc, CmplxCHOL.cc, CmplxGEPBAL.cc, MatrixType.cc,
+	Sparse-op-defs.h, Sparse.cc, SparseCmplxLU.cc, SparseCmplxQR.cc,
+	SparseQR.cc, SparsedbleLU.cc, dMatrix.cc, dNDArray.cc, dSparse.cc,
+	data-conv.cc, dbleCHOL.cc, dbleGEPBAL.cc, fCMatrix.cc, fCNDArray.cc,
+	fCmplxCHOL.cc, fCmplxGEPBAL.cc, fMatrix.cc, fNDArray.cc, file-ops.cc,
+	floatCHOL.cc, floatGEPBAL.cc, lo-sysdep.cc, oct-fftw.cc, oct-md5.cc,
+	oct-rand.cc, regex-match.cc, sparse-dmsolve.cc: Include oct-locbuf.h.
+
 2008-12-04  Jaroslav Hajek  <highegg@gmail.com>
 
 	* DiagArray2.h (DiagArray2<T>): Inherit Array<T> privately.
--- a/liboctave/CmplxCHOL.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/liboctave/CmplxCHOL.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -34,6 +34,7 @@
 #include "CmplxCHOL.h"
 #include "f77-fcn.h"
 #include "lo-error.h"
+#include "oct-locbuf.h"
 
 extern "C"
 {
--- a/liboctave/CmplxGEPBAL.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/liboctave/CmplxGEPBAL.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -31,6 +31,7 @@
 #include "CmplxGEPBAL.h"
 #include "Array-util.h"
 #include "f77-fcn.h"
+#include "oct-locbuf.h"
 
 extern "C"
 {
--- a/liboctave/MatrixType.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/liboctave/MatrixType.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -33,6 +33,7 @@
 #include "dSparse.h"
 #include "CSparse.h"
 #include "oct-spparms.h"
+#include "oct-locbuf.h"
 
 // FIXME There is a large code duplication here
 
--- a/liboctave/Sparse-op-defs.h	Fri Dec 05 12:51:48 2008 +0100
+++ b/liboctave/Sparse-op-defs.h	Wed Oct 29 16:52:10 2008 +0100
@@ -27,6 +27,7 @@
 
 #include "Array-util.h"
 #include "mx-ops.h"
+#include "oct-locbuf.h"
 
 #define SPARSE_BIN_OP_DECL(R, OP, X, Y, API) \
   extern API R OP (const X&, const Y&)
--- a/liboctave/Sparse.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/liboctave/Sparse.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -39,6 +39,7 @@
 #include "idx-vector.h"
 #include "lo-error.h"
 #include "quit.h"
+#include "oct-locbuf.h"
 
 #include "Sparse.h"
 #include "sparse-sort.h"
--- a/liboctave/SparseCmplxLU.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/liboctave/SparseCmplxLU.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -28,6 +28,7 @@
 #include <vector>
 
 #include "lo-error.h"
+#include "oct-locbuf.h"
 
 #include "SparseCmplxLU.h"
 #include "oct-spparms.h"
--- a/liboctave/SparseCmplxQR.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/liboctave/SparseCmplxQR.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -27,6 +27,7 @@
 
 #include "lo-error.h"
 #include "SparseCmplxQR.h"
+#include "oct-locbuf.h"
 
 #if defined(CS_VER) && (((CS_VER == 2) && (CS_SUBVER < 2)) || (CS_VER < 2))
 typedef double _Complex cs_complex_t;
--- a/liboctave/SparseQR.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/liboctave/SparseQR.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -27,6 +27,7 @@
 
 #include "lo-error.h"
 #include "SparseQR.h"
+#include "oct-locbuf.h"
 
 SparseQR::SparseQR_rep::SparseQR_rep (const SparseMatrix& a, int order)
 {
--- a/liboctave/SparsedbleLU.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/liboctave/SparsedbleLU.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -28,6 +28,7 @@
 #include <vector>
 
 #include "lo-error.h"
+#include "oct-locbuf.h"
 
 #include "SparsedbleLU.h"
 #include "oct-spparms.h"
--- a/liboctave/dMatrix.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/liboctave/dMatrix.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -43,6 +43,7 @@
 #include "f77-fcn.h"
 #include "functor.h"
 #include "lo-error.h"
+#include "oct-locbuf.h"
 #include "lo-ieee.h"
 #include "lo-mappers.h"
 #include "lo-utils.h"
--- a/liboctave/dNDArray.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/liboctave/dNDArray.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -37,6 +37,7 @@
 #include "lo-error.h"
 #include "lo-ieee.h"
 #include "lo-mappers.h"
+#include "oct-locbuf.h"
 
 #if defined (HAVE_FFTW3)
 #include "oct-fftw.h"
--- a/liboctave/dSparse.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/liboctave/dSparse.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -35,6 +35,7 @@
 #include "lo-mappers.h"
 #include "f77-fcn.h"
 #include "dRowVector.h"
+#include "oct-locbuf.h"
 
 #include "CSparse.h"
 #include "boolSparse.h"
--- a/liboctave/data-conv.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/liboctave/data-conv.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -35,6 +35,7 @@
 #include "data-conv.h"
 #include "lo-error.h"
 #include "lo-ieee.h"
+#include "oct-locbuf.h"
 
 template void swap_bytes<2> (volatile void *, int);
 template void swap_bytes<4> (volatile void *, int);
--- a/liboctave/dbleCHOL.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/liboctave/dbleCHOL.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -33,6 +33,7 @@
 #include "dbleCHOL.h"
 #include "f77-fcn.h"
 #include "lo-error.h"
+#include "oct-locbuf.h"
 
 extern "C"
 {
--- a/liboctave/dbleGEPBAL.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/liboctave/dbleGEPBAL.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -31,6 +31,7 @@
 #include "dbleGEPBAL.h"
 #include "Array-util.h"
 #include "f77-fcn.h"
+#include "oct-locbuf.h"
 
 extern "C"
 {
--- a/liboctave/fCMatrix.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/liboctave/fCMatrix.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -46,6 +46,7 @@
 #include "f77-fcn.h"
 #include "functor.h"
 #include "lo-error.h"
+#include "oct-locbuf.h"
 #include "lo-ieee.h"
 #include "lo-mappers.h"
 #include "lo-utils.h"
--- a/liboctave/fCNDArray.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/liboctave/fCNDArray.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -36,6 +36,7 @@
 #include "functor.h"
 #include "lo-ieee.h"
 #include "lo-mappers.h"
+#include "oct-locbuf.h"
 
 #if defined (HAVE_FFTW3)
 #include "oct-fftw.h"
--- a/liboctave/fCmplxCHOL.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/liboctave/fCmplxCHOL.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -34,6 +34,7 @@
 #include "fCmplxCHOL.h"
 #include "f77-fcn.h"
 #include "lo-error.h"
+#include "oct-locbuf.h"
 
 extern "C"
 {
--- a/liboctave/fCmplxGEPBAL.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/liboctave/fCmplxGEPBAL.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -31,6 +31,7 @@
 #include "fCmplxGEPBAL.h"
 #include "Array-util.h"
 #include "f77-fcn.h"
+#include "oct-locbuf.h"
 
 extern "C"
 {
--- a/liboctave/fMatrix.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/liboctave/fMatrix.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -42,6 +42,7 @@
 #include "f77-fcn.h"
 #include "functor.h"
 #include "lo-error.h"
+#include "oct-locbuf.h"
 #include "lo-ieee.h"
 #include "lo-mappers.h"
 #include "lo-utils.h"
--- a/liboctave/fNDArray.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/liboctave/fNDArray.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -37,6 +37,7 @@
 #include "lo-error.h"
 #include "lo-ieee.h"
 #include "lo-mappers.h"
+#include "oct-locbuf.h"
 
 #if defined (HAVE_FFTW3)
 #include "oct-fftw.h"
--- a/liboctave/file-ops.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/liboctave/file-ops.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -50,6 +50,7 @@
 #include "quit.h"
 #include "statdefs.h"
 #include "str-vec.h"
+#include "oct-locbuf.h"
 
 file_ops::static_members *file_ops::static_members::instance = 0;
 
--- a/liboctave/floatCHOL.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/liboctave/floatCHOL.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -33,6 +33,7 @@
 #include "floatCHOL.h"
 #include "f77-fcn.h"
 #include "lo-error.h"
+#include "oct-locbuf.h"
 
 extern "C"
 {
--- a/liboctave/floatGEPBAL.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/liboctave/floatGEPBAL.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -31,6 +31,7 @@
 #include "floatGEPBAL.h"
 #include "Array-util.h"
 #include "f77-fcn.h"
+#include "oct-locbuf.h"
 
 extern "C"
 {
--- a/liboctave/lo-sysdep.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/liboctave/lo-sysdep.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -48,6 +48,7 @@
 #include "pathlen.h"
 #include "lo-sysdep.h"
 #include "str-vec.h"
+#include "oct-locbuf.h"
 
 std::string
 octave_getcwd (void)
--- a/liboctave/oct-fftw.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/liboctave/oct-fftw.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -32,6 +32,7 @@
 #include "lo-error.h"
 #include "oct-fftw.h"
 #include "quit.h"
+#include "oct-locbuf.h"
 
 // Helper class to create and cache fftw plans for both 1d and
 // 2d. This implementation defaults to using FFTW_ESTIMATE to create
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/liboctave/oct-locbuf.h	Wed Oct 29 16:52:10 2008 +0100
@@ -0,0 +1,81 @@
+/*
+
+Copyright (C) 2008 Jaroslav Hajek <highegg@gmail.com>
+
+This file is part of Octave.
+
+Octave is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 3 of the License, or (at your
+option) any later version.
+
+Octave is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with Octave; see the file COPYING.  If not, see
+<http://www.gnu.org/licenses/>.
+
+*/
+
+#if !defined (octave_local_buffer_h)
+#define octave_local_buffer_h 1
+
+#include <cstddef>
+
+// The default local buffer simply encapsulates an *array* pointer that gets
+// delete[]d automatically. For common POD types, we provide specializations.
+
+template <class T>
+class octave_local_buffer
+{
+public:
+  octave_local_buffer (size_t size)
+    : data (0) 
+    { 
+      if (size) 
+        data = new T[size]; 
+    }
+  ~octave_local_buffer (void) { delete [] data; }
+  operator T *() const { return data; }
+private:
+  T *data;
+};
+
+
+// If the compiler supports dynamic stack arrays, we can use the attached hack to 
+// place small buffer arrays on the stack. 
+
+#ifdef HAVE_DYNAMIC_AUTO_ARRAYS
+
+// Maximum buffer size (in bytes) to be placed on the stack.
+
+#define OCTAVE_LOCAL_BUFFER_MAX_STACK_SIZE 8192
+
+// If we have automatic arrays, we use an automatic array if the size is small
+// enough.  To avoid possibly evaluating `size' multiple times, we first cache
+// it.  Note that we always construct both the stack array and the
+// octave_local_buffer object, but only one of them will be nonempty.
+
+#define OCTAVE_LOCAL_BUFFER(T, buf, size) \
+  const size_t _bufsize_ ## buf = size; \
+  const bool _lbufaut_ ## buf = _bufsize_ ## buf * sizeof (T) \
+     <= OCTAVE_LOCAL_BUFFER_MAX_STACK_SIZE; \
+  T _bufaut_ ## buf [_lbufaut_ ## buf ? _bufsize_ ## buf : 0]; \
+  octave_local_buffer<T> _bufheap_ ## buf (!_lbufaut_ ## buf ? _bufsize_ ## buf : 0); \
+  T *buf = _lbufaut_ ## buf ? _bufaut_ ## buf : static_cast<T *> (_bufheap_ ## buf);
+
+#else
+
+// If we don't have automatic arrays, we simply always use octave_local_buffer.
+
+#define OCTAVE_LOCAL_BUFFER(T, buf, size) \
+  octave_local_buffer<T> _buffer_ ## buf (size); \
+  T *buf = _buffer_ ## buf;
+
+#endif 
+
+#endif
+
--- a/liboctave/oct-md5.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/liboctave/oct-md5.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -30,6 +30,7 @@
 #include "lo-error.h"
 #include "oct-md5.h"
 #include "md5.h"
+#include "oct-locbuf.h"
  
 std::string
 oct_md5 (const std::string str)
--- a/liboctave/oct-rand.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/liboctave/oct-rand.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -38,6 +38,7 @@
 #include "randpoisson.h"
 #include "randgamma.h"
 #include "mach-info.h"
+#include "oct-locbuf.h"
 
 extern "C"
 {
--- a/liboctave/regex-match.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/liboctave/regex-match.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -30,6 +30,7 @@
 
 #include "regex-match.h"
 #include "str-vec.h"
+#include "oct-locbuf.h"
 
 regex_match& 
 regex_match::operator = (const regex_match& gm)
--- a/liboctave/sparse-dmsolve.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/liboctave/sparse-dmsolve.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -32,6 +32,7 @@
 #include "SparseCmplxQR.h"
 #include "MatrixType.h"
 #include "oct-sort.h"
+#include "oct-locbuf.h"
 
 template <class T>
 static MSparse<T>
--- a/src/ChangeLog	Fri Dec 05 12:51:48 2008 +0100
+++ b/src/ChangeLog	Wed Oct 29 16:52:10 2008 +0100
@@ -1,3 +1,17 @@
+2008-10-29  Jaroslav Hajek  <highegg@gmail.com>
+	* file-io.cc, gl-render.cc, load-save.cc, ls-hdf5.cc, ls-mat4.cc,
+	ls-mat5.cc, ls-oct-binary.cc, mex.cc, oct.h, ov-base-int.cc,
+	ov-bool-mat.cc, ov-bool-sparse.cc, ov-cell.cc, ov-class.cc,
+	ov-cx-mat.cc, ov-cx-sparse.cc, ov-fcn-handle.cc, ov-fcn-inline.cc,
+	ov-flt-cx-mat.cc, ov-flt-re-mat.cc, ov-re-mat.cc, ov-re-sparse.cc,
+	ov-str-mat.cc, ov-struct.cc, toplev.cc,
+	DLD-FUNCTIONS/__lin_interpn__.cc, DLD-FUNCTIONS/amd.cc,
+	DLD-FUNCTIONS/ccolamd.cc, DLD-FUNCTIONS/cellfun.cc,
+	DLD-FUNCTIONS/colamd.cc, DLD-FUNCTIONS/gcd.cc,
+	DLD-FUNCTIONS/matrix_type.cc, DLD-FUNCTIONS/regexp.cc,
+	DLD-FUNCTIONS/symbfact.cc, DLD-FUNCTIONS/symrcm.cc: 
+	Include oct-locbuf.h.
+
 2008-12-05  Jaroslav Hajek  <highegg@gmail.com>
 
 	* ov-base-diag.cc (save_ascii, load_ascii): Save natively.
--- a/src/DLD-FUNCTIONS/__lin_interpn__.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/src/DLD-FUNCTIONS/__lin_interpn__.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -25,6 +25,7 @@
 #endif
 
 #include "dNDArray.h"
+#include "oct-locbuf.h"
 
 #include "defun-dld.h"
 #include "error.h"
--- a/src/DLD-FUNCTIONS/amd.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/src/DLD-FUNCTIONS/amd.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -42,6 +42,7 @@
 #include "oct-map.h"
 
 #include "oct-sparse.h"
+#include "oct-locbuf.h"
 
 #ifdef IDX_TYPE_LONG
 #define AMD_NAME(name) amd_l ## name
--- a/src/DLD-FUNCTIONS/ccolamd.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/src/DLD-FUNCTIONS/ccolamd.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -41,6 +41,7 @@
 #include "ov-cx-sparse.h"
 
 #include "oct-sparse.h"
+#include "oct-locbuf.h"
 
 #ifdef IDX_TYPE_LONG
 #define CCOLAMD_NAME(name) ccolamd_l ## name
--- a/src/DLD-FUNCTIONS/cellfun.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/src/DLD-FUNCTIONS/cellfun.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -29,6 +29,7 @@
 #include <list>
 
 #include "lo-mappers.h"
+#include "oct-locbuf.h"
 
 #include "Cell.h"
 #include "oct-map.h"
--- a/src/DLD-FUNCTIONS/colamd.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/src/DLD-FUNCTIONS/colamd.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -42,6 +42,7 @@
 #include "ov-cx-sparse.h"
 
 #include "oct-sparse.h"
+#include "oct-locbuf.h"
 
 #ifdef IDX_TYPE_LONG
 #define COLAMD_NAME(name) colamd_l ## name
--- a/src/DLD-FUNCTIONS/gcd.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/src/DLD-FUNCTIONS/gcd.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -29,6 +29,7 @@
 #include "fNDArray.h"
 #include "fCNDArray.h"
 #include "lo-mappers.h"
+#include "oct-locbuf.h"
 
 #include "defun-dld.h"
 #include "error.h"
--- a/src/DLD-FUNCTIONS/matrix_type.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/src/DLD-FUNCTIONS/matrix_type.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -34,6 +34,7 @@
 #include "ov-re-sparse.h"
 #include "ov-cx-sparse.h"
 #include "MatrixType.h"
+#include "oct-locbuf.h"
 
 DEFUN_DLD (matrix_type, args, ,
   "-*- texinfo -*-\n\
--- a/src/DLD-FUNCTIONS/regexp.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/src/DLD-FUNCTIONS/regexp.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -39,6 +39,7 @@
 #include "str-vec.h"
 #include "quit.h"
 #include "parse.h"
+#include "oct-locbuf.h"
 
 #if defined (HAVE_PCRE)
 #include <pcre.h>
--- a/src/DLD-FUNCTIONS/symbfact.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/src/DLD-FUNCTIONS/symbfact.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -29,6 +29,7 @@
 #include "SparsedbleCHOL.h"
 #include "oct-spparms.h"
 #include "sparse-util.h"
+#include "oct-locbuf.h"
 
 #include "ov-re-sparse.h"
 #include "ov-cx-sparse.h"
--- a/src/DLD-FUNCTIONS/symrcm.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/src/DLD-FUNCTIONS/symrcm.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -59,6 +59,7 @@
 #include "error.h"
 #include "gripes.h"
 #include "utils.h"
+#include "oct-locbuf.h"
 
 #include "ov-re-mat.h"
 #include "ov-re-sparse.h"
--- a/src/file-io.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/src/file-io.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -63,6 +63,7 @@
 #include "file-stat.h"
 #include "lo-ieee.h"
 #include "oct-env.h"
+#include "oct-locbuf.h"
 
 #include "defun.h"
 #include "file-io.h"
--- a/src/gl-render.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/src/gl-render.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -27,6 +27,7 @@
 #if defined (HAVE_OPENGL)
 
 #include <lo-mappers.h>
+#include "oct-locbuf.h"
 #include "gl-render.h"
 
 #define LIGHT_MODE GL_FRONT_AND_BACK
--- a/src/load-save.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/src/load-save.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -54,6 +54,7 @@
 #include "oct-time.h"
 #include "quit.h"
 #include "str-vec.h"
+#include "oct-locbuf.h"
 
 #include "Cell.h"
 #include "defun.h"
--- a/src/ls-hdf5.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/src/ls-hdf5.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -50,6 +50,7 @@
 #include "oct-time.h"
 #include "quit.h"
 #include "str-vec.h"
+#include "oct-locbuf.h"
 
 #include "Cell.h"
 #include "defun.h"
--- a/src/ls-mat4.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/src/ls-mat4.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -44,6 +44,7 @@
 #include "oct-time.h"
 #include "quit.h"
 #include "str-vec.h"
+#include "oct-locbuf.h"
 
 #include "Cell.h"
 #include "defun.h"
--- a/src/ls-mat5.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/src/ls-mat5.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -48,6 +48,7 @@
 #include "quit.h"
 #include "str-vec.h"
 #include "file-stat.h"
+#include "oct-locbuf.h"
 
 #include "Cell.h"
 #include "defun.h"
--- a/src/ls-oct-binary.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/src/ls-oct-binary.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -44,6 +44,7 @@
 #include "oct-time.h"
 #include "quit.h"
 #include "str-vec.h"
+#include "oct-locbuf.h"
 
 #include "Cell.h"
 #include "defun.h"
--- a/src/mex.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/src/mex.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -33,6 +33,7 @@
 
 #include "f77-fcn.h"
 #include "lo-ieee.h"
+#include "oct-locbuf.h"
 
 // mxArray must be declared as a class before including mexproto.h.
 class mxArray;
--- a/src/oct.h	Fri Dec 05 12:51:48 2008 +0100
+++ b/src/oct.h	Wed Oct 29 16:52:10 2008 +0100
@@ -32,6 +32,7 @@
 
 #include "Matrix.h"
 
+#include "oct-locbuf.h"
 #include "defun-dld.h"
 #include "error.h"
 #include "gripes.h"
--- a/src/ov-base-int.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/src/ov-base-int.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -33,6 +33,7 @@
 #include "lo-utils.h"
 #include "mx-base.h"
 #include "quit.h"
+#include "oct-locbuf.h"
 
 #include "defun.h"
 #include "gripes.h"
--- a/src/ov-bool-mat.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/src/ov-bool-mat.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -30,6 +30,7 @@
 
 #include "lo-ieee.h"
 #include "mx-base.h"
+#include "oct-locbuf.h"
 
 #include "gripes.h"
 #include "oct-obj.h"
--- a/src/ov-bool-sparse.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/src/ov-bool-sparse.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -36,6 +36,7 @@
 #include "ov-bool-mat.h"
 #include "gripes.h"
 #include "ops.h"
+#include "oct-locbuf.h"
 
 #include "ov-re-sparse.h"
 #include "ov-cx-sparse.h"
--- a/src/ov-cell.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/src/ov-cell.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -34,6 +34,7 @@
 #include "byte-swap.h"
 #include "lo-utils.h"
 #include "quit.h"
+#include "oct-locbuf.h"
 
 #include "defun.h"
 #include "error.h"
--- a/src/ov-class.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/src/ov-class.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -28,6 +28,7 @@
 
 #include "Array-util.h"
 #include "byte-swap.h"
+#include "oct-locbuf.h"
 
 #include "Cell.h"
 #include "defun.h"
--- a/src/ov-cx-mat.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/src/ov-cx-mat.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -34,6 +34,7 @@
 #include "lo-mappers.h"
 #include "mx-base.h"
 #include "mach-info.h"
+#include "oct-locbuf.h"
 
 #include "gripes.h"
 #include "oct-obj.h"
--- a/src/ov-cx-sparse.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/src/ov-cx-sparse.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -32,6 +32,7 @@
 
 #include "lo-specfun.h"
 #include "lo-mappers.h"
+#include "oct-locbuf.h"
 
 #include "ov-base.h"
 #include "ov-scalar.h"
--- a/src/ov-fcn-handle.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/src/ov-fcn-handle.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -29,6 +29,7 @@
 #include <vector>
 
 #include "file-ops.h"
+#include "oct-locbuf.h"
 
 #include "defun.h"
 #include "error.h"
--- a/src/ov-fcn-inline.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/src/ov-fcn-inline.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -33,6 +33,8 @@
 #include <sstream>
 #include <vector>
 
+#include "oct-locbuf.h"
+
 #include "defun.h"
 #include "error.h"
 #include "gripes.h"
--- a/src/ov-flt-cx-mat.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/src/ov-flt-cx-mat.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -34,6 +34,7 @@
 #include "lo-mappers.h"
 #include "mx-base.h"
 #include "mach-info.h"
+#include "oct-locbuf.h"
 
 #include "gripes.h"
 #include "oct-obj.h"
--- a/src/ov-flt-re-mat.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/src/ov-flt-re-mat.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -38,6 +38,7 @@
 #include "mach-info.h"
 #include "mx-base.h"
 #include "quit.h"
+#include "oct-locbuf.h"
 
 #include "defun.h"
 #include "gripes.h"
--- a/src/ov-re-mat.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/src/ov-re-mat.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -38,6 +38,7 @@
 #include "mach-info.h"
 #include "mx-base.h"
 #include "quit.h"
+#include "oct-locbuf.h"
 
 #include "defun.h"
 #include "gripes.h"
--- a/src/ov-re-sparse.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/src/ov-re-sparse.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -32,6 +32,7 @@
 
 #include "lo-specfun.h"
 #include "lo-mappers.h"
+#include "oct-locbuf.h"
 
 #include "ov-base.h"
 #include "ov-scalar.h"
--- a/src/ov-str-mat.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/src/ov-str-mat.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -34,6 +34,7 @@
 #include "lo-ieee.h"
 #include "mach-info.h"
 #include "mx-base.h"
+#include "oct-locbuf.h"
 
 #include "defun.h"
 #include "byte-swap.h"
--- a/src/ov-struct.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/src/ov-struct.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -39,6 +39,7 @@
 #include "variables.h"
 
 #include "Array-util.h"
+#include "oct-locbuf.h"
 
 #include "byte-swap.h"
 #include "ls-oct-ascii.h"
--- a/src/toplev.cc	Fri Dec 05 12:51:48 2008 +0100
+++ b/src/toplev.cc	Wed Oct 29 16:52:10 2008 +0100
@@ -50,6 +50,7 @@
 #include "oct-env.h"
 #include "quit.h"
 #include "str-vec.h"
+#include "oct-locbuf.h"
 
 #include <defaults.h>
 #include "defun.h"