develooper Front page | perl.perl5.porters | Postings from March 2013

Re: [perl #117239] Re: [perl #117259] Re: Bleadperlv5.17.9-200-g0e0ab62breaks MLEHMANN/JSON-XS-2.33.tar.gz

Thread Previous | Thread Next
From:
Eric Brine
Date:
March 26, 2013 00:47
Subject:
Re: [perl #117239] Re: [perl #117259] Re: Bleadperlv5.17.9-200-g0e0ab62breaks MLEHMANN/JSON-XS-2.33.tar.gz
Message ID:
CALJW-qF4EXNJ+cTd8xJBdH33f6sa_Y1Y+Dopo1cjGVauOU0CoQ@mail.gmail.com
On Sun, Mar 24, 2013 at 4:00 PM, bulk88 <bulk88@hotmail.com> wrote:

> Konovalov, Vadim (Vadim)** CTR ** wrote:
>
>> It was clearly and unambiguously a patch. It wasn't in diff format, but it
>>> was clearly indicating that to make your code more portable, you could
>>> change  the line:
>>>
>>>     HE *hes [count];
>>> to
>>>     #if defined(__BORLANDC__) || defined(_MSC_VER) || defined(__STDC__)
>>>         HE **hes = Perl_malloc (count * sizeof (HE));
>>>     #else
>>>         HE *hes [count];
>>>     #endif
>>>
>>
>> 1)
>> an overlook - it should be      HE **hes = Perl_malloc (count * sizeof
>> (HE*));
>>
>> it appears that HE is larger than HE* and allocating more memory, hence
>> misbehaviour is not noticed, but anyway, this isn't correct
>>
>> 2) when that chunk of memory freed? TIA :)
>>
>
> alloca, it can never leak. A non-const length auto C array calls alloca
> anyway on C99 under the hood.
>

I think he's asking about the newly introduced Perl_malloc

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