** Initialize the string table and the string cache */
| 104 | ** Initialize the string table and the string cache |
| 105 | */ |
| 106 | void 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 |
no test coverage detected