MCPcopy Create free account
hub / github.com/WaykiChain/WaykiChain / luaS_init

Function luaS_init

src/vm/luavm/lua/lstring.c:106–115  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

104** Initialize the string table and the string cache
105*/
106void luaS_init (lua_State *L) {
107 global_State *g = G(L);
108 int i;
109 luaS_resize(L, MINSTRTABSIZE); /* initial size of string table */
110 /* pre-create memory-error message */
111 g->memerrmsg = luaS_newliteral(L, MEMERRMSG);
112 luaC_fix(L, obj2gco(g->memerrmsg)); /* it should never be collected */
113 for (i = 0; i < STRCACHE_SIZE; i++) /* fill cache with valid strings */
114 g->strcache[i][0] = g->memerrmsg;
115}
116
117
118

Callers 1

f_luaopenFunction · 0.85

Calls 2

luaS_resizeFunction · 0.85
luaC_fixFunction · 0.85

Tested by

no test coverage detected