On Wed, May 26, 2004 at 01:51:56PM -0700 Bill Moseley wrote:

> BTW -- I also was wondering how best to check for leaks in the Perl/XS
> code -- make sure all my objects are destroyed like I expect.

For XS modules, I'd always use valgrind (http://valgrind.kde.org/):

    perl Makefile.PL OPTIMIZE=-g
    make
    valgrind --leak-check=yes perl -MYourModule -e 'some_code()'

You will get a detailed report of memory that wasn't freed and the
location where this memory was allocated if you compile your module with
debugging symbols (perl itself need not be compile with debugging
enabled).

It can also report on other things, such as accessing non-allocated
blocks of memory etc.

Tassilo
-- 
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval

Reply via email to