Move lightuserdata names to the end of the struct for better cache coherency

This commit is contained in:
Petri Häkkinen 2023-12-14 09:48:38 +02:00
parent 29d59ad40c
commit f70376eb19

View file

@ -197,7 +197,6 @@ typedef struct global_State
struct Table* mt[LUA_T_COUNT]; // metatables for basic types
TString* ttname[LUA_T_COUNT]; // names for basic types
TString* tmname[TM_N]; // array with tag-method names
TString* lightuserdataname[LUA_LUTAG_LIMIT]; // names for tagged lightuserdata
TValue pseudotemp; // storage for temporary values used in pseudo2addr
@ -215,6 +214,8 @@ typedef struct global_State
void (*udatagc[LUA_UTAG_LIMIT])(lua_State*, void*); // for each userdata tag, a gc callback to be called immediately before freeing memory
TString* lightuserdataname[LUA_LUTAG_LIMIT]; // names for tagged lightuserdata
GCStats gcstats;
#ifdef LUAI_GCMETRICS