MCPcopy Create free account
hub / github.com/Tencent/sluaunreal / luaS_init

Function luaS_init

Plugins/slua_unreal/External/lua/lstring.cpp:115–125  ·  view source on GitHub ↗

** Initialize the string table and the string cache */

Source from the content-addressed store, hash-verified

113** Initialize the string table and the string cache
114*/
115void luaS_init (lua_State *L) {
116 global_State *g = G(L);
117 int i, j;
118 luaS_resize(L, MINSTRTABSIZE); /* initial size of string table */
119 /* pre-create memory-error message */
120 g->memerrmsg = luaS_newliteral(L, MEMERRMSG);
121 luaC_fix(L, obj2gco(g->memerrmsg)); /* it should never be collected */
122 for (i = 0; i < STRCACHE_N; i++) /* fill cache with valid strings */
123 for (j = 0; j < STRCACHE_M; j++)
124 g->strcache[i][j] = g->memerrmsg;
125}
126
127
128

Callers 1

f_luaopenFunction · 0.85

Calls 3

GFunction · 0.85
luaS_resizeFunction · 0.85
luaC_fixFunction · 0.85

Tested by

no test coverage detected