[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Does LUA switch the C stack?
- From: Axel Mamode <axel@...>
- Date: Wed, 05 Sep 2007 10:02:07 +0200
Lothar Scholz wrote:
Does LUA switch the C stack in any way when using coroutines? I'm 99%
sure the answer is no because it can't be done with ANSI C.
No. The luavm in general does not use the C stack for much. The
exception is coroutines (where there is a recursive call to the vm for
resume, and a return for yield) and C calls (well, obviously, you have
to call the C function with some C stack space).
As you mentioned, it is all ANSI C, no raw manipulation of the C stack
is involved.
For more information, see The implementation of Lua 5.0, by R.
Ierusalimschy, L. H. de Figueiredo, W. Celes:
http://www.tecgraf.puc-rio.br/~lhf/ftp/doc/jucs05.pdf
Page 11 talks about exactly that.