# HG changeset patch # User jwe # Date 1036159827 0 # Node ID 0739d46e778cab56a7fcb5469851115b749a949f # Parent 8c710385c5723d64e30bd23eea707952cc759784 [project @ 2002-11-01 14:10:27 by jwe] diff -r 8c710385c572 -r 0739d46e778c liboctave/Array2.cc --- a/liboctave/Array2.cc Fri Nov 01 04:20:44 2002 +0000 +++ b/liboctave/Array2.cc Fri Nov 01 14:10:27 2002 +0000 @@ -44,6 +44,9 @@ // Two dimensional array class. +// A guess (should be quite conservative). +#define MALLOC_OVERHEAD 1024 + template int Array2::get_size (int r, int c) const @@ -57,9 +60,6 @@ // most current hardware, but not so large to cause the // allocator to barf on computing retval * sizeof (T). - // A guess (should be quite conservative). - static const int MALLOC_OVERHEAD = 1024; - static int nl; static double dl = frexp (static_cast @@ -89,6 +89,8 @@ return (nt < nl || (nt == nl && dt < dl)) ? r * c : max_items; } +#undef MALLOC_OVERHEAD + template T Array2::range_error (const char *fcn, int i, int j) const diff -r 8c710385c572 -r 0739d46e778c liboctave/ArrayN.cc --- a/liboctave/ArrayN.cc Fri Nov 01 04:20:44 2002 +0000 +++ b/liboctave/ArrayN.cc Fri Nov 01 14:10:27 2002 +0000 @@ -69,6 +69,9 @@ return retval; } +// A guess (should be quite conservative). +#define MALLOC_OVERHEAD 1024 + template int ArrayN::get_size (const Array& arr_idx) @@ -82,9 +85,6 @@ // most current hardware, but not so large to cause the // allocator to barf on computing retval * sizeof (T). - // A guess (should be quite conservative). - static const int MALLOC_OVERHEAD = 1024; - static int nl; static double dl = frexp (static_cast @@ -131,6 +131,8 @@ return retval; } +#undef MALLOC_OVERHEAD + template T ArrayN::range_error (const char *fcn, const Array& arr_idx) const diff -r 8c710385c572 -r 0739d46e778c liboctave/ChangeLog --- a/liboctave/ChangeLog Fri Nov 01 04:20:44 2002 +0000 +++ b/liboctave/ChangeLog Fri Nov 01 14:10:27 2002 +0000 @@ -1,3 +1,9 @@ +2002-11-01 John W. Eaton + + * Array2.cc (Array2::get_size): #define MALLOC_OVERHEAD to + avoid OS X linker bug. + * ArrayN.cc (ArrayN::get_size): Likewise. + 2002-10-31 John W. Eaton * ODESFunc.h (ODESFunc::ODES_fsub, ODESFunc::ODES_bsub,