Revision: 1140
Author: [email protected]
Date: Mon Mar  8 01:49:47 2010
Log: Move file version processing into the load_perl_callback(). It isn't actually
a file tag, but the code is simpler if it is treated as one.
http://code.google.com/p/perl-devel-nytprof/source/detail?r=1140

Modified:
 /trunk/FileHandle.h
 /trunk/NYTProf.xs

=======================================
--- /trunk/FileHandle.h Mon Mar  8 01:49:02 2010
+++ /trunk/FileHandle.h Mon Mar  8 01:49:47 2010
@@ -61,6 +61,7 @@

 typedef enum {
     nytp_no_tag,
+ nytp_version, /* Not actually a tag, but needed by the perl callback */
     nytp_attribute,
     nytp_comment,
     nytp_time_block,
=======================================
--- /trunk/NYTProf.xs   Mon Mar  8 01:49:42 2010
+++ /trunk/NYTProf.xs   Mon Mar  8 01:49:47 2010
@@ -4046,6 +4046,7 @@
 static struct perl_callback_info_t callback_info[nytp_tag_max] =
 {
     {STR_WITH_LEN("[no tag]"), NULL},
+    {STR_WITH_LEN("VERSION"), "uu"},
     {STR_WITH_LEN("ATTRIBUTE"), "33"},
     {STR_WITH_LEN("COMMENT"), "3"},
     {STR_WITH_LEN("TIME_BLOCK"), "00uuuuu"},
@@ -4179,7 +4180,6 @@
 load_profile_data_from_stream(SV *cb)
 {
     dTHX;
-    dSP;
     int file_major, file_minor;

     unsigned long input_chunk_seqn = 0L;
@@ -4255,14 +4255,7 @@
         for (i = 0; i < C_ARRAY_LENGTH(cb_args); i++)
             cb_args[i] = sv_newmortal();

-        PUSHMARK(SP);
-        i = 0;
-        sv_setpvs(cb_args[i], "VERSION");  XPUSHs(cb_args[i++]);
-        sv_setiv(cb_args[i], file_major);  XPUSHs(cb_args[i++]);
-        sv_setiv(cb_args[i], file_minor);  XPUSHs(cb_args[i++]);
-        PUTBACK;
-        call_sv(cb, G_DISCARD);
-        SPAGAIN;
+        load_perl_callback(&state, nytp_version, file_major, file_minor);
     }
     else {
         cb = Nullsv;

--
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