diff src/pt-unop.cc @ 12960:43d78e103984

Use macro to start profiler blocks. profile.h: Define macros BEGIN/END_PROFILER_BLOCK. ov-builtin.cc: Use it. ov-mex-fcn.cc: Ditto. ov-usr-fcn.cc: Ditto. pt-binop.cc: Ditto. pt-unop.cc: Ditto.
author Daniel Kraft <d@domob.eu>
date Fri, 12 Aug 2011 12:21:48 +0200
parents 5d18231eee00
children e81ddf9cacd5
line wrap: on
line diff
--- a/src/pt-unop.cc
+++ b/src/pt-unop.cc
@@ -73,13 +73,14 @@
 
           if (! error_state)
             {
-              profile_data_accumulator::enter pe (profiler,
-                                                  "prefix " + oper ());
+              BEGIN_PROFILER_BLOCK ("prefix " + oper ())
               
               ref.do_unary_op (etype);
 
               if (! error_state)
                 retval = ref.value ();
+
+              END_PROFILER_BLOCK
             }
         }
       else
@@ -88,8 +89,7 @@
 
           if (! error_state && val.is_defined ())
             {
-              profile_data_accumulator::enter pe (profiler,
-                                                  "prefix " + oper ());
+              BEGIN_PROFILER_BLOCK ("prefix " + oper ())
 
               // Attempt to do the operation in-place if it is unshared
               // (a temporary expression).
@@ -100,6 +100,8 @@
 
               if (error_state)
                 retval = octave_value ();
+
+              END_PROFILER_BLOCK
             }
         }
     }
@@ -160,10 +162,9 @@
             {
               retval = ref.value ();
 
-              profile_data_accumulator::enter pe (profiler,
-                                                  "postfix " + oper ());
-
+              BEGIN_PROFILER_BLOCK ("postfix " + oper ())
               ref.do_unary_op (etype);
+              END_PROFILER_BLOCK
             }
         }
       else
@@ -172,13 +173,14 @@
 
           if (! error_state && val.is_defined ())
             {
-              profile_data_accumulator::enter pe (profiler,
-                                                  "postfix " + oper ());
+              BEGIN_PROFILER_BLOCK ("postfix " + oper ())
 
               retval = ::do_unary_op (etype, val);
 
               if (error_state)
                 retval = octave_value ();
+
+              END_PROFILER_BLOCK
             }
         }
     }