Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Is this a memory leak? (Math::Factor::XS)

2 views
Skip to first unread message

Ben Bullock

unread,
Mar 29, 2013, 10:37:36 PM3/29/13
to per...@perl.org
I am just looking at someone else's code here:


From the recent discussion on this list, I get the impression that is a memory leak of "factors". Is that a correct understanding? Should I report this as a bug?

Also, what is the test module for XS memory leaks on objects created via newAV, newHV?

Ben Bullock

unread,
Mar 29, 2013, 10:40:08 PM3/29/13
to per...@perl.org
Sorry, I think I overlooked this:

https://github.com/benkasminbullock/Math-Factor-XS/blob/master/XS.xs#L62

This is reducing the reference count, right? So no leak. Sorry about the noise.

bulk88

unread,
Mar 30, 2013, 12:18:04 AM3/30/13
to Ben Bullock, per...@perl.org
factors is freed at
https://github.com/benkasminbullock/Math-Factor-XS/blob/master/XS.xs#L64
unless a croak/die happen, then it is leaked. It doesn't look like there
is any code that will do that tho, so I think the code looks fine. If
you want another opinion, ask on Perlmonks.
0 new messages