lua-users home
lua-l archive

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


> As per the book named as 《Programming in Lua》,which said that[emphasise mine]:
> A nice idiom is {string.byte(s, 1, -1)}, which creates a list with the
> codes of all characters in s. (This idiom only works for strings somewhat
> shorter than 1 MB. **Lua limits its stack size**, which in turn limits the
> maximum number of returns from a function. The default stack limit is
> one million entries.
> 
> Then, a question raises.
> Is there any method or funtion that could danamically resize the size
> of Lua's stack?

Lua automatically resizes the stack when needed. The limit mentioned
in the book is a hard limit, to avoid a faulty recursive function
consuming all available memory.

-- Roberto