For PL_compiling, don't count the actual OP
Florian Ragwitz [Mon, 1 Oct 2012 02:04:16 +0000 (11:04 +0900)]
It's either stored in the data section or in the PerlInterpreter struct, so it
should not be counted or counted as part of struct PerlInterpreter. However, we
do wanna count things referenced from PL_compiling, such as cop_file and the
hints hash, if present.

Memory.xs

index 77d5c50..30f8c9e 100644 (file)
--- a/Memory.xs
+++ b/Memory.xs
@@ -1471,7 +1471,7 @@ perl_size(pTHX_ struct state *const st, pPATH)
   check_new_and_strlen(st, PL_inplace, NPathLink("PL_inplace"));
   /* TODO PL_pidstatus */
   /* TODO PL_stashpad */
-  op_size_class(aTHX_ &PL_compiling, OPc_COP, 0, st, NPathLink("PL_compiling"));
+  op_size_class(aTHX_ &PL_compiling, OPc_COP, 1, st, NPathLink("PL_compiling"));
 
   /* TODO stacks: cur, main, tmps, mark, scope, save */
   /* TODO PL_exitlist */