mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 22:31:28 +02:00
MINOR: lua-thread: Stop usage of struct hlua for the global lua state
The goal is to no longer use "struct hlua" with global main lua_state. The usage of the "struct hlua" is no longer required. This patch replaces this struct by another one. Now, the usage of runtime Lua phase is separated from the start lua phase.
This commit is contained in:
parent
4234dbd03b
commit
92689e651e
@ -157,7 +157,9 @@ static int hlua_panic_ljmp(lua_State *L) { WILL_LJMP(longjmp(safe_ljmp_env, 1));
|
||||
#define APPLET_RSP_SENT 0x40 /* The response was fully sent */
|
||||
|
||||
/* The main Lua execution context. */
|
||||
struct hlua gL;
|
||||
struct {
|
||||
lua_State *T;
|
||||
} gL;
|
||||
|
||||
/* This is the memory pool containing struct lua for applets
|
||||
* (including cli).
|
||||
@ -8400,12 +8402,7 @@ void hlua_init(void)
|
||||
#endif
|
||||
|
||||
/* Init main lua stack. */
|
||||
gL.Mref = LUA_REFNIL;
|
||||
gL.flags = 0;
|
||||
LIST_INIT(&gL.com);
|
||||
gL.T = lua_newstate(hlua_alloc, &hlua_global_allocator);
|
||||
gL.Tref = LUA_REFNIL;
|
||||
gL.task = NULL;
|
||||
|
||||
/* Initialise Lua context to NULL */
|
||||
context = lua_getextraspace(gL.T);
|
||||
|
Loading…
x
Reference in New Issue
Block a user