** Initialize the string table and the string cache */
| 114 | ** Initialize the string table and the string cache |
| 115 | */ |
| 116 | void 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 |
no test coverage detected