|
native Lua
0.5.0-devel
Lua on the platform you use with the compiler you choose
|
Go to the documentation of this file.
27 typedef LUAI_MEM
l_mem;
30 typedef ptrdiff_t
l_mem;
43 #define MAX_SIZET ((size_t)(~(size_t)0))
46 #define MAX_SIZE (sizeof(size_t) < sizeof(lua_Integer) ? MAX_SIZET \
47 : (size_t)(LUA_MAXINTEGER))
50 #define MAX_LUMEM ((lu_mem)(~(lu_mem)0))
52 #define MAX_LMEM ((l_mem)(MAX_LUMEM >> 1))
55 #define MAX_INT INT_MAX
62 #define log2maxs(t) (sizeof(t) * 8 - 2)
68 #define ispow2(x) (((x) & ((x) - 1)) == 0)
72 #define LL(x) (sizeof(x)/sizeof(char) - 1)
80 #define point2uint(p) ((unsigned int)((size_t)(p) & UINT_MAX))
90 #if defined(lua_assert)
91 #define check_exp(c,e) (lua_assert(c), (e))
93 #define lua_longassert(c) ((c) ? (void)0 : lua_assert(0))
95 #define lua_assert(c) ((void)0)
96 #define check_exp(c,e) (e)
97 #define lua_longassert(c) ((void)0)
103 #if !defined(luai_apicheck)
104 #define luai_apicheck(l,e) ((void)l, lua_assert(e))
107 #define api_check(l,e,msg) luai_apicheck(l,(e) && msg)
112 #define UNUSED(x) ((void)(x))
117 #define cast(t, exp) ((t)(exp))
119 #define cast_void(i) cast(void, (i))
120 #define cast_voidp(i) cast(void *, (i))
121 #define cast_num(i) cast(lua_Number, (i))
122 #define cast_int(i) cast(int, (i))
123 #define cast_uint(i) cast(unsigned int, (i))
124 #define cast_byte(i) cast(lu_byte, (i))
125 #define cast_uchar(i) cast(unsigned char, (i))
126 #define cast_char(i) cast(char, (i))
127 #define cast_charp(i) cast(char *, (i))
128 #define cast_sizet(i) cast(size_t, (i))
132 #if !defined(l_castS2U)
133 #define l_castS2U(i) ((lua_Unsigned)(i))
141 #if !defined(l_castU2S)
142 #define l_castU2S(i) ((lua_Integer)(i))
151 #if defined(__GNUC__)
152 #define likely(x) (__builtin_expect(((x) != 0), 1))
153 #define unlikely(x) (__builtin_expect(((x) != 0), 0))
155 #define likely(x) (x)
156 #define unlikely(x) (x)
165 #if !defined(l_noret)
167 #if defined(__GNUC__)
168 #define l_noret void __attribute__((noreturn))
169 #elif defined(_MSC_VER) && _MSC_VER >= 1200
170 #define l_noret void __declspec(noreturn)
198 #if !defined(LUAI_MAXSHORTLEN)
199 #define LUAI_MAXSHORTLEN 40
209 #if !defined(MINSTRTABSIZE)
210 #define MINSTRTABSIZE 128
219 #if !defined(STRCACHE_N)
220 #define STRCACHE_N 53
226 #if !defined(LUA_MINBUFFER)
227 #define LUA_MINBUFFER 32
235 #if !defined(lua_lock)
236 #define lua_lock(L) ((void) 0)
237 #define lua_unlock(L) ((void) 0)
244 #if !defined(luai_threadyield)
245 #define luai_threadyield(L) {lua_unlock(L); lua_lock(L);}
253 #if !defined(luai_userstateopen)
254 #define luai_userstateopen(L) ((void)L)
257 #if !defined(luai_userstateclose)
258 #define luai_userstateclose(L) ((void)L)
261 #if !defined(luai_userstatethread)
262 #define luai_userstatethread(L,L1) ((void)L)
265 #if !defined(luai_userstatefree)
266 #define luai_userstatefree(L,L1) ((void)L)
269 #if !defined(luai_userstateresume)
270 #define luai_userstateresume(L,n) ((void)L)
273 #if !defined(luai_userstateyield)
274 #define luai_userstateyield(L,n) ((void)L)
284 #if !defined(luai_numidiv)
285 #define luai_numidiv(L,a,b) ((void)L, l_floor(luai_numdiv(L,a,b)))
289 #if !defined(luai_numdiv)
290 #define luai_numdiv(L,a,b) ((a)/(b))
304 #if !defined(luai_nummod)
305 #define luai_nummod(L,a,b,m) \
306 { (void)L; (m) = l_mathop(fmod)(a,b); \
307 if (((m) > 0) ? (b) < 0 : ((m) < 0 && (b) > 0)) (m) += (b); }
311 #if !defined(luai_numpow)
312 #define luai_numpow(L,a,b) ((void)L, l_mathop(pow)(a,b))
316 #if !defined(luai_numadd)
317 #define luai_numadd(L,a,b) ((a)+(b))
318 #define luai_numsub(L,a,b) ((a)-(b))
319 #define luai_nummul(L,a,b) ((a)*(b))
320 #define luai_numunm(L,a) (-(a))
321 #define luai_numeq(a,b) ((a)==(b))
322 #define luai_numlt(a,b) ((a)<(b))
323 #define luai_numle(a,b) ((a)<=(b))
324 #define luai_numgt(a,b) ((a)>(b))
325 #define luai_numge(a,b) ((a)>=(b))
326 #define luai_numisnan(a) (!luai_numeq((a), (a)))
336 #if !defined(HARDSTACKTESTS)
337 #define condmovestack(L,pre,pos) ((void)0)
340 #define condmovestack(L,pre,pos) \
341 { int sz_ = (L)->stacksize; pre; luaD_reallocstack((L), sz_, 0); pos; }
344 #if !defined(HARDMEMTESTS)
345 #define condchangemem(L,pre,pos) ((void)0)
347 #define condchangemem(L,pre,pos) \
348 { if (G(L)->gcrunning) { pre; luaC_fullgc(L, 0); pos; } }
signed char ls_byte
Definition: llimits.h:39
#define LUAI_UACNUMBER
Definition: luaconf.h:475
native Lua configuration file
unsigned long lu_mem
Definition: llimits.h:32
long l_mem
Definition: llimits.h:33
LUAI_UACINT l_uacInt
Definition: llimits.h:86
unsigned char lu_byte
Definition: llimits.h:38
unsigned long l_uint32
Definition: llimits.h:185
#define LUAI_UACINT
Definition: luaconf.h:513
l_uint32 Instruction
Definition: llimits.h:188
LUAI_UACNUMBER l_uacNumber
Definition: llimits.h:85