lua-users home
lua-l archive

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


OK just being sure here....

In LUA...

cow = function(moo, bleat)

In API

moo = (int)lua_tonumber(L,1);
bleat = (int)lua_tonumber(L,2);

lua_pushnumber(L,5);
return 1;

In LUA...
???? Do I need to call anything to clean up my parameters???
Or do I need to call a parameter to clean up my L state 
externally..possibly who ever called the lua_tobuffer?.

Terence




--- In lua-l@y..., "Matt Holmes" <matt@k...> wrote:
> Its the responsability of the calling host to clean up the stack 
using
> lua_pop().
> 
> -----Original Message-----
> From: owner-lua-l@t...
> [mailto:owner-lua-l@t...]On Behalf Of terenctb
> Sent: Wednesday, March 27, 2002 8:27 PM
> To: Multiple recipients of list
> Subject: LUA stack values to API?
> 
> 
> Quick question, lua uses the 'stack' for passing paramters back and
> forth.. that's how we pass stuff to the API..If I pass 3 parameters
> down to an API from lua is it the responsiblity of the API to pop
> those values off the stack...clearing it?....I know the API
> lua_tonumber doesn't seem to pop the values off the stack...after
> running a while, won't the stack just implode or how does lua do
> garbage collection?
> 
> 
> Terence