** creates a new string object */
| 141 | ** creates a new string object |
| 142 | */ |
| 143 | static TString *createstrobj (lua_State *L, size_t l, int tag, unsigned int h) { |
| 144 | TString *ts; |
| 145 | GCObject *o; |
| 146 | size_t totalsize; /* total size of TString object */ |
| 147 | totalsize = sizelstring(l); |
| 148 | o = luaC_newobj(L, tag, totalsize); |
| 149 | ts = gco2ts(o); |
| 150 | ts->hash = h; |
| 151 | ts->extra = 0; |
| 152 | getstr(ts)[l] = '\0'; /* ending 0 */ |
| 153 | return ts; |
| 154 | } |
| 155 | |
| 156 | |
| 157 | TString *luaS_createlngstrobj (lua_State *L, size_t l) { |
no test coverage detected