aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/luajit-2.0/src/lj_state.h
diff options
context:
space:
mode:
authorDavid Walter Seikel2012-01-23 23:36:30 +1000
committerDavid Walter Seikel2012-01-23 23:36:30 +1000
commit6523585c66c04cea54df50013df8886b589847d8 (patch)
tree0b22aee7064166d88595eda260ca2d17c0773da5 /libraries/luajit-2.0/src/lj_state.h
parentUpdate the EFL to what I'm actually using, coz I'm using some stuff not yet r... (diff)
downloadSledjHamr-6523585c66c04cea54df50013df8886b589847d8.zip
SledjHamr-6523585c66c04cea54df50013df8886b589847d8.tar.gz
SledjHamr-6523585c66c04cea54df50013df8886b589847d8.tar.bz2
SledjHamr-6523585c66c04cea54df50013df8886b589847d8.tar.xz
Add luaproc and LuaJIT libraries.
Two versions of LuaJIT, the stable release, and the dev version. Try the dev version first, until ih fails badly.
Diffstat (limited to 'libraries/luajit-2.0/src/lj_state.h')
-rw-r--r--libraries/luajit-2.0/src/lj_state.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/libraries/luajit-2.0/src/lj_state.h b/libraries/luajit-2.0/src/lj_state.h
new file mode 100644
index 0000000..75b8dc8
--- /dev/null
+++ b/libraries/luajit-2.0/src/lj_state.h
@@ -0,0 +1,35 @@
1/*
2** State and stack handling.
3** Copyright (C) 2005-2011 Mike Pall. See Copyright Notice in luajit.h
4*/
5
6#ifndef _LJ_STATE_H
7#define _LJ_STATE_H
8
9#include "lj_obj.h"
10
11#define incr_top(L) \
12 (++L->top >= tvref(L->maxstack) && (lj_state_growstack1(L), 0))
13
14#define savestack(L, p) ((char *)(p) - mref(L->stack, char))
15#define restorestack(L, n) ((TValue *)(mref(L->stack, char) + (n)))
16
17LJ_FUNC void lj_state_relimitstack(lua_State *L);
18LJ_FUNC void lj_state_shrinkstack(lua_State *L, MSize used);
19LJ_FUNCA void LJ_FASTCALL lj_state_growstack(lua_State *L, MSize need);
20LJ_FUNC void LJ_FASTCALL lj_state_growstack1(lua_State *L);
21
22static LJ_AINLINE void lj_state_checkstack(lua_State *L, MSize need)
23{
24 if ((mref(L->maxstack, char) - (char *)L->top) <=
25 (ptrdiff_t)need*(ptrdiff_t)sizeof(TValue))
26 lj_state_growstack(L, need);
27}
28
29LJ_FUNC lua_State *lj_state_new(lua_State *L);
30LJ_FUNC void LJ_FASTCALL lj_state_free(global_State *g, lua_State *L);
31#if LJ_64
32LJ_FUNC lua_State *lj_state_newstate(lua_Alloc f, void *ud);
33#endif
34
35#endif