lua-users home
lua-l archive

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


>> Just like the return values of any function.
>
>Thanks. I presume that means that as per the notice "you are responsible for
>controlling stack overflow", that means that after calling lua_dostring it
>is necessary to call lua_settop(L, 0) to remove any remaining stack elements
>before calling lua_dostring again (to avoid eventual stack overflow)?

Yes, but lua_settop(L,n), where was n=lua_gettop(L) before the call to
lua_dostring. Or lua_pop(L,k), where k is the number of values returned
by lua_dostring (computed as the difference of lua_gettop(L) before and after
the call.

>This used to be handled by lua_beginblock/lua_endblock, didn't it?

Yes.
--lhf