** creates a new string object */
| 153 | ** creates a new string object |
| 154 | */ |
| 155 | static TString *createstrobj (lua_State *L, size_t l, int tag, unsigned int h) { |
| 156 | TString *ts; |
| 157 | GCObject *o; |
| 158 | size_t totalsize; /* total size of TString object */ |
| 159 | totalsize = sizelstring(l); |
| 160 | o = luaC_newobj(L, tag, totalsize); |
| 161 | ts = gco2ts(o); |
| 162 | ts->hash = h; |
| 163 | ts->extra = 0; |
| 164 | getstr(ts)[l] = '\0'; /* ending 0 */ |
| 165 | return ts; |
| 166 | } |
| 167 | |
| 168 | |
| 169 | TString *luaS_createlngstrobj (lua_State *L, size_t l) { |
no test coverage detected