Revision: 1146
Author: [email protected]
Date: Mon Mar  8 01:50:19 2010
Log: Move input_chunk_seqn_sv into Loader_state_merged;
http://code.google.com/p/perl-devel-nytprof/source/detail?r=1146

Modified:
 /trunk/NYTProf.xs

=======================================
--- /trunk/NYTProf.xs   Mon Mar  8 01:50:14 2010
+++ /trunk/NYTProf.xs   Mon Mar  8 01:50:19 2010
@@ -3510,6 +3510,8 @@
     SV *cb;
SV *cb_args[11]; /* must be large enough for the largest callback argument list */
     SV *tag_names[nytp_tag_max];
+    SV *input_chunk_seqn_sv;
+
     unsigned int last_file_num;
     unsigned int last_line_num;
     int statement_discount;
@@ -4096,6 +4098,8 @@
         else
             croak("Unknown type %d passed to perl callback", tag);
     }
+
+ sv_setuv_mg(state->input_chunk_seqn_sv, state->base_state.input_chunk_seqn);

     va_start(args, tag);

@@ -4240,9 +4244,6 @@
     SV *tmp_str1_sv = newSVpvn("",0);
     SV *tmp_str2_sv = newSVpvn("",0);

-    /* callback support */
-    SV *input_chunk_seqn_sv = NULL;
-
     size_t buffer_len = MAXPATHLEN * 2;
     char *buffer = (char *)safemalloc(buffer_len);

@@ -4289,8 +4290,8 @@

     if (cb && SvROK(cb)) {
         int i;
-        input_chunk_seqn_sv = save_scalar(gv_fetchpv(".", GV_ADD, SVt_IV));
-        sv_setuv(input_chunk_seqn_sv, state->input_chunk_seqn);
+ merged_state.input_chunk_seqn_sv = save_scalar(gv_fetchpv(".", GV_ADD, SVt_IV)); + sv_setuv(merged_state.input_chunk_seqn_sv, state->input_chunk_seqn);

         i = C_ARRAY_LENGTH(merged_state.tag_names);
         while (--i) {
@@ -4330,10 +4331,6 @@
         }

         state->input_chunk_seqn++;
-        if (cb) {
-            sv_setuv_mg(input_chunk_seqn_sv, state->input_chunk_seqn);
-        }
-
         if (trace_level >= 6)
             logwarn("Chunk %lu token is %d ('%c') at %ld%s\n",
                     state->input_chunk_seqn, c, c, NYTP_tell(in)-1,

--
You've received this message because you are subscribed to
the Devel::NYTProf Development User group.

Group hosted at:  http://groups.google.com/group/develnytprof-dev
Project hosted at:  http://perl-devel-nytprof.googlecode.com
CPAN distribution:  http://search.cpan.org/dist/Devel-NYTProf

To post, email:  [email protected]
To unsubscribe, email:  [email protected]

Reply via email to