[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Are there some potential problems if I use a self-defined memory acquirement function instead of realloc(3) in the l_alloc function?
- From: 孙世龙 sunshilong <sunshilong369@...>
- Date: Wed, 12 Aug 2020 09:04:48 +0800
> >Lua relies on the behaviour that the realloc-like function
> >does not return a different pointer (copy) for shrinking an existing
> >block.
>That is not true. Where did you read that?
>From the reply of Stefan.
Thank you for taking the time to respond to me.
I understand it now. Thank you.
BTW, I still have a question.
What are the potential problems if the restriction(l_alloc can't fail
when shrinking the block) can't be guaranteed?
Thank you for your attention to this matter.
On Wed, Aug 12, 2020 at 3:00 AM Roberto Ierusalimschy
<roberto@inf.puc-rio.br> wrote:
>
> > >Lua relies on the behaviour that the realloc-like function
> > >does not return a different pointer (copy) for shrinking an existing
> > >block.
>
> That is not true. Where did you read that?
>
> -- Roberto