lua-users home
lua-l archive

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

> What problems may occur if the restriction(i.e. l_alloc should not
> fail when shrinking the block) is broken?

The usual problems that occur when an assumption in some code is
wrong: Algorithms do not work as expected, which may leave the program
in some inconsistent state, which may result in crashes, memory leaks,
wrong results, etc. As an example, see the function luaH_resize in file
lgc.c and figure out what happens if the call after the comment "shrink
array" raises an error and interrupts the resize.

-- Roberto