MCPcopy Create free account
hub / github.com/DFHack/dfhack / luaS_init

Function luaS_init

depends/lua/src/lstring.c:116–126  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

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

Callers 1

f_luaopenFunction · 0.85

Calls 2

luaS_resizeFunction · 0.85
luaC_fixFunction · 0.85

Tested by

no test coverage detected