Re: help with memory leak

[email protected] (Xavier Noria)
Newsgroups perl.xs
Message-ID <[email protected]>
On Fri, Jan 28, 2011 at 11:31 AM,  <[email protected]> wrote:

> Can't answer your leaking memory/reference count problem,
> but please consider these points:
>
> 1. Generally when you iterate over a length, you want
>    for (i = 0; i < len_data; ++i)   [not <=]

Yeah, in this case len_data is named after the "len" in "av_len".
Despite its name, that function returns the highest index value,
rather than the array length.


> 2. You're iterating i over the length of data.  Are
>   you sure that odometer is long enough to support
>   GETIV(odometer, i) ??

Yes, both come from the Perl side:

    my @odometer = (1) x @$data;

Thanks anyway!
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.