[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: RE: Pop Return results after pcall'ing
- From: "Jerome Vuarand" <jerome.vuarand@...>
- Date: Thu, 26 Oct 2006 18:38:25 -0400
All return values are discarded after being used. There is no such problem with the stack size, you don't have to manage anything in your C functions.
And on the other hand you cannot use the stack as a storage place for your objects. If you want them to be preserved after the call to your C function you have to put them in some table.
-----Message d'origine-----
De : lua-bounces@bazar2.conectiva.com.br [mailto:lua-bounces@bazar2.conectiva.com.br] De la part de Beric Holt
Envoyé : 26 octobre 2006 18:06
À : Lua list
Objet : Pop Return results after pcall'ing
I've previously asked about whether function parameters are automatically pop'ed off the stack after the function call
(http://lua-users.org/lists/lua-l/2006-03/msg00074.html) but what happens if you don't pop the returned values after you have finished with them. I assume that the stack will simple grow indefinitely until you run out of memory?
Cheers
Beric Holt
http://buzzrick.true.geek.nz