[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua alloc function with just malloc and free causes crash
- From: roberto@... (Roberto Ierusalimschy)
- Date: Mon, 7 Aug 2006 09:49:34 -0300
> The Lua documentation states that Lua assumes that the allocator never
> fails when osize >= nsize. Does Lua also assume that the following
> expression always evaluates to true when osize >= nsize?
>
> ptr == my_alloc(void *ud, void *ptr, size_t osize, size_t nsize)
>
No. You can move the block when shrinking it.
-- Roberto