[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: block-scope finalization
- From: Roberto Ierusalimschy <roberto@...>
- Date: Tue, 24 Nov 2015 14:50:42 -0200
> I thought about reserving stack slots (using `lua_settop`) in front
> of the arguments/results of `lua_pcall` and then shifting the
> results so that there are free stack slots available at the top.
> However, if I can't even call Lua API functions (`lua_remove` or
> `lua_copy`) in a save way after the `lua_pcall`, that won't work.
>
> Are there any functions that are guaranteed to work without any
> available stack slots (e.g. `lua_settop` and `lua_pop` should work,
> as well as `lua_checkstack`)?
All API functions that do not push stuff (as flagged in its documentaion)
should work without any available stack slots. That includes both
lua_remove and lua_copy (and lua_rotate, which seems your best option
for moving the results).
-- Roberto
- References:
- Re: block-scope finalization, Viacheslav Usov
- Re: block-scope finalization, Philipp Janda
- Re: block-scope finalization, Philipp Janda
- Re: block-scope finalization, Viacheslav Usov
- Re: block-scope finalization, Roberto Ierusalimschy
- Re: block-scope finalization, Philipp Janda
- Re: block-scope finalization, Roberto Ierusalimschy
- Re: block-scope finalization, Philipp Janda
- Re: block-scope finalization, Roberto Ierusalimschy
- Re: block-scope finalization, Philipp Janda