develooper Front page | perl.perl5.porters | Postings from October 2021

Re: leak testing modules [was: [Encode] 3.15 Released]

Thread Previous | Thread Next
Eric Wong
October 12, 2021 00:42
Re: leak testing modules [was: [Encode] 3.15 Released]
Message ID:
"Paul \"LeoNerd\" Evans" <> wrote:
> On Mon, 11 Oct 2021 20:43:09 +0000
> Eric Wong <> wrote:
> > Does anybody here have suggestions on how to go about adding
> > leak tests to packages like Encode?
> I usually use Test::Refcount.

Thanks for the response, but can that check for allocations made
(and lost) from inside XS?

The leaks which got fixed in Encode was created by newSV() and
the SV not being mortalized; so it got lost on croak and AFAIK
that can't be tested by pure Perl.  Something like valgrind
could notice that leak, as would (AFAIK) PL_sv_count.

Adding valgrind to a test suite seems heavy-handed; so I wonder
if XS::APITests::sv_count should be moved to Devel::Peek or

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About