** creates a new string object */
| 131 | ** creates a new string object |
| 132 | */ |
| 133 | static TString *createstrobj (lua_State *L, size_t l, int tag, unsigned int h) { |
| 134 | TString *ts; |
| 135 | GCObject *o; |
| 136 | size_t totalsize; /* total size of TString object */ |
| 137 | totalsize = sizelstring(l); |
| 138 | o = luaC_newobj(L, tag, totalsize); |
| 139 | ts = gco2ts(o); |
| 140 | ts->hash = h; |
| 141 | ts->extra = 0; |
| 142 | getstr(ts)[l] = '\0'; /* ending 0 */ |
| 143 | return ts; |
| 144 | } |
| 145 | |
| 146 | |
| 147 | TString *luaS_createlngstrobj (lua_State *L, size_t l) { |
no test coverage detected