lua-users home
lua-l archive

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


> I think Lua relies on the behaviour that the realloc-like function
> does not return a different pointer (copy) for shrinking an existing
> block. Maybe that could be a problem for some allocators.

Lua does not rely on that. The only assumption was that shrinking
an existing block could not fail, but it can move the block without
problems. Actually, the test suite in Lua has a mode that forces every
single reallocation (growing, shrinking, or to the same size!) to move
the block.

Lua 5.4 has removed this restriction of "no fail when shrinking".

-- Roberto