diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-06-20 13:43:33 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-06-20 13:43:33 -0300 |
commit | 55ac40f859ad8e28fe71a8801d49f4a4140e8aa3 (patch) | |
tree | 1a1f02de45d28c7eb8976087ade773d7937bed14 /lapi.h | |
parent | 97ef8e7bd40340d47a9789beb06f0128d7438d0a (diff) | |
download | lua-55ac40f859ad8e28fe71a8801d49f4a4140e8aa3.tar.gz lua-55ac40f859ad8e28fe71a8801d49f4a4140e8aa3.tar.bz2 lua-55ac40f859ad8e28fe71a8801d49f4a4140e8aa3.zip |
Cleaning of llimits.h
Several definitions that don't need to be "global" (that is, that
concerns only specific parts of the code) moved out of llimits.h,
to more appropriate places.
Diffstat (limited to 'lapi.h')
-rw-r--r-- | lapi.h | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -12,12 +12,32 @@ | |||
12 | #include "lstate.h" | 12 | #include "lstate.h" |
13 | 13 | ||
14 | 14 | ||
15 | #if defined(LUA_USE_APICHECK) | ||
16 | #include <assert.h> | ||
17 | #define api_check(l,e,msg) assert(e) | ||
18 | #else /* for testing */ | ||
19 | #define api_check(l,e,msg) ((void)(l), lua_assert((e) && msg)) | ||
20 | #endif | ||
21 | |||
22 | |||
23 | |||
15 | /* Increments 'L->top.p', checking for stack overflows */ | 24 | /* Increments 'L->top.p', checking for stack overflows */ |
16 | #define api_incr_top(L) \ | 25 | #define api_incr_top(L) \ |
17 | (L->top.p++, api_check(L, L->top.p <= L->ci->top.p, "stack overflow")) | 26 | (L->top.p++, api_check(L, L->top.p <= L->ci->top.p, "stack overflow")) |
18 | 27 | ||
19 | 28 | ||
20 | /* | 29 | /* |
30 | ** macros that are executed whenever program enters the Lua core | ||
31 | ** ('lua_lock') and leaves the core ('lua_unlock') | ||
32 | */ | ||
33 | #if !defined(lua_lock) | ||
34 | #define lua_lock(L) ((void) 0) | ||
35 | #define lua_unlock(L) ((void) 0) | ||
36 | #endif | ||
37 | |||
38 | |||
39 | |||
40 | /* | ||
21 | ** If a call returns too many multiple returns, the callee may not have | 41 | ** If a call returns too many multiple returns, the callee may not have |
22 | ** stack space to accommodate all results. In this case, this macro | 42 | ** stack space to accommodate all results. In this case, this macro |
23 | ** increases its stack space ('L->ci->top.p'). | 43 | ** increases its stack space ('L->ci->top.p'). |