diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-07-19 17:34:22 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-07-19 17:34:22 -0300 |
commit | f407b3c4a1bc9667867ec51e835c20d97aab55a2 (patch) | |
tree | ad629983fbde70d5446411d765a99a1b724eb82b /lapi.h | |
parent | a546138d158d79d44b2c5b42630be00d306f4e7c (diff) | |
download | lua-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.h | 16 |
1 files changed, 0 insertions, 16 deletions
@@ -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 |