aboutsummaryrefslogtreecommitdiff
path: root/lapi.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2024-07-19 17:34:22 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2024-07-19 17:34:22 -0300
commitf407b3c4a1bc9667867ec51e835c20d97aab55a2 (patch)
treead629983fbde70d5446411d765a99a1b724eb82b /lapi.h
parenta546138d158d79d44b2c5b42630be00d306f4e7c (diff)
downloadlua-f407b3c4a1bc9667867ec51e835c20d97aab55a2.tar.gz
lua-f407b3c4a1bc9667867ec51e835c20d97aab55a2.tar.bz2
lua-f407b3c4a1bc9667867ec51e835c20d97aab55a2.zip
Using CIST_CLSRET instead of trick with 'nresults'
The callstatus flag CIST_CLSRET is used in all tests for the presence of variables to be closed in C functions.
Diffstat (limited to 'lapi.h')
-rw-r--r--lapi.h16
1 files changed, 0 insertions, 16 deletions
diff --git a/lapi.h b/lapi.h
index 21be4a24..9b545344 100644
--- a/lapi.h
+++ b/lapi.h
@@ -62,20 +62,4 @@
62 L->tbclist.p < L->top.p - (n), \ 62 L->tbclist.p < L->top.p - (n), \
63 "not enough free elements in the stack") 63 "not enough free elements in the stack")
64 64
65
66/*
67** To reduce the overhead of returning from C functions, the presence of
68** to-be-closed variables in these functions is coded in the CallInfo's
69** field 'nresults', in a way that functions with no to-be-closed variables
70** with zero, one, or "all" wanted results have no overhead. Functions
71** with other number of wanted results, as well as functions with
72** variables to be closed, have an extra check.
73*/
74
75#define hastocloseCfunc(n) ((n) < LUA_MULTRET)
76
77/* Map [-1, inf) (range of 'nresults') into (-inf, -2] */
78#define codeNresults(n) (-(n) - 3)
79#define decodeNresults(n) (-(n) - 3)
80
81#endif 65#endif