mirror of
https://github.com/luau-lang/luau.git
synced 2025-04-19 19:23:49 +01:00
move userdata to lua_Callbacks
This commit is contained in:
parent
2a26c09660
commit
150c92185e
3 changed files with 2 additions and 3 deletions
|
@ -356,6 +356,8 @@ struct lua_Callbacks
|
||||||
void (*debugstep)(lua_State* L, lua_Debug* ar); /* gets called after each instruction in single step mode */
|
void (*debugstep)(lua_State* L, lua_Debug* ar); /* gets called after each instruction in single step mode */
|
||||||
void (*debuginterrupt)(lua_State* L, lua_Debug* ar); /* gets called when thread execution is interrupted by break in another thread */
|
void (*debuginterrupt)(lua_State* L, lua_Debug* ar); /* gets called when thread execution is interrupted by break in another thread */
|
||||||
void (*debugprotectederror)(lua_State* L); /* gets called when protected call results in an error */
|
void (*debugprotectederror)(lua_State* L); /* gets called when protected call results in an error */
|
||||||
|
|
||||||
|
void* userdata; /* arbitrary userdata pointer that is never overwritten by Luau */
|
||||||
};
|
};
|
||||||
|
|
||||||
LUA_API lua_Callbacks* lua_callbacks(lua_State* L);
|
LUA_API lua_Callbacks* lua_callbacks(lua_State* L);
|
||||||
|
|
|
@ -181,7 +181,6 @@ lua_State* lua_newstate(lua_Alloc f, void* ud)
|
||||||
|
|
||||||
g->cb = lua_Callbacks();
|
g->cb = lua_Callbacks();
|
||||||
g->gcstats = GCStats();
|
g->gcstats = GCStats();
|
||||||
g->userdata = NULL;
|
|
||||||
|
|
||||||
if (luaD_rawrunprotected(L, f_luaopen, NULL) != 0)
|
if (luaD_rawrunprotected(L, f_luaopen, NULL) != 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -189,8 +189,6 @@ typedef struct global_State
|
||||||
|
|
||||||
GCStats gcstats;
|
GCStats gcstats;
|
||||||
|
|
||||||
void* userdata;
|
|
||||||
|
|
||||||
} global_State;
|
} global_State;
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue