aboutsummaryrefslogtreecommitdiff
path: root/ldo.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2022-10-29 12:06:37 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2022-10-29 12:06:37 -0300
commit413a393e6222482f46599e138bebac162610a572 (patch)
tree181517f8ec8d56f9101de33f4891729044f244de /ldo.h
parentba089bcb08a0efc6c26fb5c1e3c9d61c00cc012c (diff)
downloadlua-413a393e6222482f46599e138bebac162610a572.tar.gz
lua-413a393e6222482f46599e138bebac162610a572.tar.bz2
lua-413a393e6222482f46599e138bebac162610a572.zip
Stack indices changed to union's
That will allow to change pointers to offsets while reallocating the stack.
Diffstat (limited to 'ldo.h')
-rw-r--r--ldo.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/ldo.h b/ldo.h
index 4661aa00..1aa446ad 100644
--- a/ldo.h
+++ b/ldo.h
@@ -8,6 +8,7 @@
8#define ldo_h 8#define ldo_h
9 9
10 10
11#include "llimits.h"
11#include "lobject.h" 12#include "lobject.h"
12#include "lstate.h" 13#include "lstate.h"
13#include "lzio.h" 14#include "lzio.h"
@@ -23,7 +24,7 @@
23** at every check. 24** at every check.
24*/ 25*/
25#define luaD_checkstackaux(L,n,pre,pos) \ 26#define luaD_checkstackaux(L,n,pre,pos) \
26 if (l_unlikely(L->stack_last - L->top <= (n))) \ 27 if (l_unlikely(L->stack_last.p - L->top.p <= (n))) \
27 { pre; luaD_growstack(L, n, 1); pos; } \ 28 { pre; luaD_growstack(L, n, 1); pos; } \
28 else { condmovestack(L,pre,pos); } 29 else { condmovestack(L,pre,pos); }
29 30
@@ -32,8 +33,8 @@
32 33
33 34
34 35
35#define savestack(L,p) ((char *)(p) - (char *)L->stack) 36#define savestack(L,pt) (cast_charp(pt) - cast_charp(L->stack.p))
36#define restorestack(L,n) ((StkId)((char *)L->stack + (n))) 37#define restorestack(L,n) cast(StkId, cast_charp(L->stack.p) + (n))
37 38
38 39
39/* macro to check stack size, preserving 'p' */ 40/* macro to check stack size, preserving 'p' */