lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


>What matters is what the language
>standards say, and what they say is that realloc() is permitted to fail
>when shrinking a block. (Some realloc implementations never fail in that
>case, but many in common use do.)
Could you please please give me some references or documents for me to
go through?
What about malloc(3) provided by the stand C library?

Best Regards.
Sunshilong

On Tue, Aug 11, 2020 at 10:10 AM Andrew Gierth
<andrew@tao11.riddles.org.uk> wrote:
>
> >>>>> "Philippe" == Philippe Verdy <verdyp@gmail.com> writes:
>
>  Philippe> I don't think thank shrinking or keeping the same size may
>  Philippe> fail
>
> It doesn't matter what you think. What matters is what the language
> standards say, and what they say is that realloc() is permitted to fail
> when shrinking a block. (Some realloc implementations never fail in that
> case, but many in common use do.)
>
> --
> Andrew.