aboutsummaryrefslogtreecommitdiff
path: root/lapi.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2021-02-12 13:36:30 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2021-02-12 13:36:30 -0300
commitbc970005ce2e258e29a5c315ea4e49f76a66586e (patch)
tree5575ca66aeddad2036df74f38fa2bed217c2801e /lapi.h
parentf79ccdca9bbe9d486d91a44a4464b99ce38de0e2 (diff)
downloadlua-bc970005ce2e258e29a5c315ea4e49f76a66586e.tar.gz
lua-bc970005ce2e258e29a5c315ea4e49f76a66586e.tar.bz2
lua-bc970005ce2e258e29a5c315ea4e49f76a66586e.zip
'__close' methods can yield in the return of a C function
When, inside a coroutine, a C function with to-be-closed slots return, the corresponding metamethods can yield. ('__close' metamethods called through 'lua_closeslot' still cannot yield, as there is no continuation to go when resuming.)
Diffstat (limited to 'lapi.h')
-rw-r--r--lapi.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/lapi.h b/lapi.h
index 41216b27..9e99cc44 100644
--- a/lapi.h
+++ b/lapi.h
@@ -42,6 +42,8 @@
42 42
43#define hastocloseCfunc(n) ((n) < LUA_MULTRET) 43#define hastocloseCfunc(n) ((n) < LUA_MULTRET)
44 44
45/* Map [-1, inf) (range of 'nresults') into (-inf, -2] */
45#define codeNresults(n) (-(n) - 3) 46#define codeNresults(n) (-(n) - 3)
47#define decodeNresults(n) (-(n) - 3)
46 48
47#endif 49#endif