folks,

I just tried to modify Devel::Size to teach it to compute the size
of subroutines.  Since B::Concise can walk an optree,
Im trying to call it (perl code) from Devel::Size::thing_size
(XS code).

Ive followed the recipe in perldoc perlcall (1 arg, 1 retval),
but its blowing up on me.


[EMAIL PROTECTED] Devel-Size-0.58-x1]$  perl5.9.2 -d -I blib/lib/ -I
blib/arch/ t/basic.t
 
Loading DB routines from perl5db.pl version 1.28
Editor support available.
 
Enter h or `h h' for help, or `man perldebug' for more help.
 
1..7
main::(t/basic.t:12):   $loaded = 1;
  DB<1> c
ok 1
ok 2
ok 3
ok 4
ok 5
ok 6
ok 7
in size_ccv, 98cd75c
SvIOK(SV*):0
SvNOK(SV*):0
SvPOK(SV*):0
SvROK(SV*):0
SV = PVCV(0x97792b8) at 0x98cd75c
  REFCNT = 2
  FLAGS = ()
  IV = 0
  NV = 0
  COMP_STASH = 0x9552b04        "main"
  START = 0x98b3b30 ===> 0
  ROOT = 0x956e6b0
  XSUB = 0x0
  XSUBANY = 0
  GVGV::GV = 0x98cd798  "main" :: "foo"
  FILE = "t/basic.t"
  DEPTH = 0
  FLAGS = 0x0
  OUTSIDE_SEQ = 2606
  PADLIST = 0x98cd768
  OUTSIDE = 0x9552de0 (MAIN)
size_CV:
Devel::Size::size_CV(blib/lib//Devel/Size.pm:42):
42:         my $cvref = shift;

NOTE THE LACK OF AN ARGUMENT !

  DB<1> T
$ = Devel::Size::size_CV('') called from file `t/basic.t' line 74
$ = eval {...} called from file `t/basic.t' line 74
  DB<1> s
Uh oh - Bizarre copy of CODE in sassign at blib/lib//Devel/Size.pm line 42.
 
CV size = 160225208
size of regular sub: 160225208
main::(t/basic.t:76):   my $sub = sub { print "hello world\n" };
  DB<1>


If you look at the patch, youll note my confusion wrt how to
pass params in this case.  It seems to be different from the
perlcall recipe in ways I dont grok.


thx in advance
jimc

Attachment: diff.dev-size-2
Description: Binary data

Reply via email to