PERL_DEBUG=1 PERL_VALGRIND=1 PERL_DESTRUCT_LEVEL=2
valgrind --leak-check=full perl -e 'sub k {1}'
####
PERL_DEBUG=1 PERL_VALGRIND=1 PERL_DESTRUCT_LEVEL=2
valgrind --leak-check=full perl -e 'sub k () {1}'
####
==4943== Memcheck, a memory error detector for x86-linux.
==4943== Copyright (C) 2002-2005, and GNU GPL'd, by Julian Seward et al.
==4943== Using valgrind-2.4.0, a program supervision framework for x86-linux.
==4943== Copyright (C) 2000-2005, and GNU GPL'd, by Julian Seward et al.
==4943== For more details, rerun with: -v
==4943==
==4943==
==4943== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 17 from 1)
==4943== malloc/free: in use at exit: 3 bytes in 1 blocks.
==4943== malloc/free: 775 allocs, 774 frees, 84102 bytes allocated.
==4943== For counts of detected errors, rerun with: -v
==4943== searching for pointers to 1 not-freed blocks.
==4943== checked 282624 bytes.
==4943==
==4943== 3 bytes in 1 blocks are definitely lost in loss record 1 of 1
==4943== at 0x1B909222: malloc (vg_replace_malloc.c:130)
==4943== by 0x80C698C: Perl_safesysmalloc (util.c:78)
==4943== by 0x80C8152: Perl_savepv (util.c:774)
==4943== by 0x80A5AE6: Perl_newCONSTSUB (op.c:4554)
==4943== by 0x80A4994: Perl_newATTRSUB (op.c:4305)
==4943== by 0x8097207: Perl_yyparse (perly.y:364)
==4943== by 0x806433E: S_parse_body (perl.c:1844)
==4943== by 0x8062FBA: perl_parse (perl.c:1308)
==4943== by 0x805F658: main (perlmain.c:96)
==4943==
==4943== LEAK SUMMARY:
==4943== definitely lost: 3 bytes in 1 blocks.
==4943== possibly lost: 0 bytes in 0 blocks.
==4943== still reachable: 0 bytes in 0 blocks.
==4943== suppressed: 0 bytes in 0 blocks.
==4943== Reachable blocks (those to which a pointer was found) are not shown.
==4943== To see them, rerun with: --show-reachable=yes