# HG changeset patch # User John W. Eaton # Date 1360015635 18000 # Node ID 1aff8c38c53cc45956f9153534e327cae769a0e1 # Parent 906ae17055223d7cf4c0acb49a5de723bf26be84 use octave_local_buffer for temporary arrays in quadcc * quadcc.cc (Fquadcc): Use OCTAVE_LOCAL_BUFFER for local arrays. diff -r 906ae1705522 -r 1aff8c38c53c libinterp/corefcn/quadcc.cc --- a/libinterp/corefcn/quadcc.cc Mon Feb 04 11:10:14 2013 -0800 +++ b/libinterp/corefcn/quadcc.cc Mon Feb 04 17:07:15 2013 -0500 @@ -1552,14 +1552,10 @@ static const double w = M_SQRT2 / 2; static const int ndiv_max = 20; - /* The interval heap. */ - cquad_ival *ivals; - int *heap; - /* Arguments left and right */ int nargin = args.length (); octave_function *fcn; - double a, b, tol, *iivals, *sing; + double a, b, tol, *sing; /* Variables needed for transforming the integrand. */ bool wrap = false; @@ -1639,9 +1635,10 @@ int cquad_heapsize = (nivals >= min_cquad_heapsize ? nivals + 1 : min_cquad_heapsize); - heap = new int [cquad_heapsize]; - ivals = new cquad_ival [cquad_heapsize]; - iivals = new double [cquad_heapsize]; + /* The interval heap. */ + OCTAVE_LOCAL_BUFFER (cquad_ival, ivals, cquad_heapsize); + OCTAVE_LOCAL_BUFFER (double, iivals, cquad_heapsize); + OCTAVE_LOCAL_BUFFER (int, heap, cquad_heapsize); if (nivals == 1) { @@ -2243,11 +2240,6 @@ } #endif - /* Clean up heap memory */ - delete [] heap; - delete [] ivals; - delete [] iivals; - /* Clean up and present the results. */ if (nargout > 2) retval(2) = neval;