changeset 28817:aef839f40da2

Replace unwind_protect with more efficient constructs (bug #59192). * __eigs__.cc, daspk.cc, dasrt.cc, dassl.cc, lsode.cc, quad.cc: Replace unwind_protect frame and protect_var() call for variable "call_depth" with unwind_protect_var().
author Rik <rik@octave.org>
date Tue, 29 Sep 2020 06:59:13 -0700
parents 0eb855b7798b
children 6ec04c206ac4
files libinterp/corefcn/__eigs__.cc libinterp/corefcn/daspk.cc libinterp/corefcn/dasrt.cc libinterp/corefcn/dassl.cc libinterp/corefcn/lsode.cc libinterp/corefcn/quad.cc
diffstat 6 files changed, 6 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/__eigs__.cc	Tue Sep 29 15:37:52 2020 +0200
+++ b/libinterp/corefcn/__eigs__.cc	Tue Sep 29 06:59:13 2020 -0700
@@ -199,9 +199,7 @@
 
   warned_imaginary = false;
 
-  octave::unwind_protect frame;
-
-  frame.protect_var (call_depth);
+  octave::unwind_protect_var<int> restore_var (call_depth);
   call_depth++;
 
   if (call_depth > 1)
--- a/libinterp/corefcn/daspk.cc	Tue Sep 29 15:37:52 2020 +0200
+++ b/libinterp/corefcn/daspk.cc	Tue Sep 29 06:59:13 2020 -0700
@@ -269,9 +269,7 @@
 
   octave_value_list retval (4);
 
-  octave::unwind_protect frame;
-
-  frame.protect_var (call_depth);
+  octave::unwind_protect_var<int> restore_var (call_depth);
   call_depth++;
 
   if (call_depth > 1)
--- a/libinterp/corefcn/dasrt.cc	Tue Sep 29 15:37:52 2020 +0200
+++ b/libinterp/corefcn/dasrt.cc	Tue Sep 29 06:59:13 2020 -0700
@@ -348,9 +348,7 @@
 
   octave_value_list retval (5);
 
-  octave::unwind_protect frame;
-
-  frame.protect_var (call_depth);
+  octave::unwind_protect_var<int> restore_var (call_depth);
   call_depth++;
 
   if (call_depth > 1)
--- a/libinterp/corefcn/dassl.cc	Tue Sep 29 15:37:52 2020 +0200
+++ b/libinterp/corefcn/dassl.cc	Tue Sep 29 06:59:13 2020 -0700
@@ -269,9 +269,7 @@
 
   octave_value_list retval (4);
 
-  octave::unwind_protect frame;
-
-  frame.protect_var (call_depth);
+  octave::unwind_protect_var<int> restore_var (call_depth);
   call_depth++;
 
   if (call_depth > 1)
--- a/libinterp/corefcn/lsode.cc	Tue Sep 29 15:37:52 2020 +0200
+++ b/libinterp/corefcn/lsode.cc	Tue Sep 29 06:59:13 2020 -0700
@@ -269,9 +269,7 @@
   warned_fcn_imaginary = false;
   warned_jac_imaginary = false;
 
-  octave::unwind_protect frame;
-
-  frame.protect_var (call_depth);
+  octave::unwind_protect_var<int> restore_var (call_depth);
   call_depth++;
 
   if (call_depth > 1)
--- a/libinterp/corefcn/quad.cc	Tue Sep 29 15:37:52 2020 +0200
+++ b/libinterp/corefcn/quad.cc	Tue Sep 29 06:59:13 2020 -0700
@@ -180,9 +180,7 @@
 
   warned_imaginary = false;
 
-  octave::unwind_protect frame;
-
-  frame.protect_var (call_depth);
+  octave::unwind_protect_var<int> restore_var (call_depth);
   call_depth++;
 
   if (call_depth > 1)