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_mallocThread Previous | Thread Next