Skip to content

Commit

Permalink
move userdata to lua_Callbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
LoganDark committed Nov 7, 2021
1 parent 2a26c09 commit 150c921
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
2 changes: 2 additions & 0 deletions VM/include/lua.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 (*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* userdata; /* arbitrary userdata pointer that is never overwritten by Luau */
};

LUA_API lua_Callbacks* lua_callbacks(lua_State* L);
Expand Down
1 change: 0 additions & 1 deletion VM/src/lstate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ lua_State* lua_newstate(lua_Alloc f, void* ud)

g->cb = lua_Callbacks();
g->gcstats = GCStats();
g->userdata = NULL;

if (luaD_rawrunprotected(L, f_luaopen, NULL) != 0)
{
Expand Down
2 changes: 0 additions & 2 deletions VM/src/lstate.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,6 @@ typedef struct global_State

GCStats gcstats;

void* userdata;

} global_State;
// clang-format on

Expand Down

0 comments on commit 150c921

Please sign in to comment.