[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Is there any method or funtion that could danamically resize the size of Lua's stack?
- From: Roberto Ierusalimschy <roberto@...>
- Date: Fri, 16 Oct 2020 09:41:25 -0300
> 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