develooper Front page | perl.qa | Postings from August 2022

Re: Having memory leak issues with perl-c

Thread Previous | Thread Next
From:
Mark Murawski
Date:
August 12, 2022 22:26
Subject:
Re: Having memory leak issues with perl-c
Message ID:
1ee614a8-d1af-a3a2-242e-2d3c8304c061@intellasoft.net
On 8/12/22 18:11, Mark Murawski wrote:
> On 8/4/22 15:10, demerphq wrote:
>> On Thu, 4 Aug 2022 at 17:04, Mark Murawski 
>> <markm-lists@intellasoft.net> wrote:
>>
>>     On 8/4/22 02:50, demerphq wrote:
>>>     On Thu, 4 Aug 2022 at 01:58, Mark Murawski
>>>     <markm-lists@intellasoft.net> wrote:
>>>
>>>         I'm still not getting something... if I want to fix the
>>>         code-as-is and do this:
>>>
>>>             FNsv = get_sv("main::_FN", GV_ADD);
>>>             if (!FNsv)
>>>                 ereport(ERROR,
>>>         (errcode(ERRCODE_EXTERNAL_ROUTINE_EXCEPTION),
>>>                          errmsg("couldn't fetch $_FN")));
>>>
>>>             save_item(FNsv);            /* local $_FN */
>>>
>>>
>>>     I dont get the sequence here. You take the old value of
>>>     $main::_FN and then you localize it after you fetch it? That
>>>     seems weird.
>>
>>
>> You did not respond to this comment ^^
>
>
> The reason for the save_item*( was because I was modeling this code on 
> another section that uses save_item() to accomplish something similar 
> (to send internal postgres details to some perl).  I don't know why 
> the original author uses save_item() for this purpose.
>

Oh... I know why save_item is used.  It's because this code can be 
executed multiple times in the same perl process.  So each one needs 
it's own _FN


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About