From f70376eb198e179ec3e0fccafeed2ecd427c4c69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petri=20H=C3=A4kkinen?= Date: Thu, 14 Dec 2023 09:48:38 +0200 Subject: [PATCH] Move lightuserdata names to the end of the struct for better cache coherency --- VM/src/lstate.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/VM/src/lstate.h b/VM/src/lstate.h index 808f57b9..2c6d35dc 100644 --- a/VM/src/lstate.h +++ b/VM/src/lstate.h @@ -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