aboutsummaryrefslogtreecommitdiff
path: root/lapi.h
diff options
context:
space:
mode:
Diffstat (limited to 'lapi.h')
-rw-r--r--lapi.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/lapi.h b/lapi.h
index 43845648..757bf3d2 100644
--- a/lapi.h
+++ b/lapi.h
@@ -29,8 +29,18 @@
29 29
30/* Ensure the stack has at least 'n' elements */ 30/* Ensure the stack has at least 'n' elements */
31#define api_checknelems(L,n) \ 31#define api_checknelems(L,n) \
32 api_check(L, (n) < (L->top.p - L->ci->func.p), \ 32 api_check(L, (n) < (L->top.p - L->ci->func.p), \
33 "not enough elements in the stack") 33 "not enough elements in the stack")
34
35
36/* Ensure the stack has at least 'n' elements to be popped. (Some
37** functions only update a slot after checking it for popping, but that
38** is only an optimization for a pop followed by a push.)
39*/
40#define api_checkpop(L,n) \
41 api_check(L, (n) < L->top.p - L->ci->func.p && \
42 L->tbclist.p < L->top.p - (n), \
43 "not enough free elements in the stack")
34 44
35 45
36/* 46/*