MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / createstrobj

Function createstrobj

3rd/lua-5.4.3/src/lstring.c:143–154  ·  view source on GitHub ↗

** creates a new string object */

Source from the content-addressed store, hash-verified

141** creates a new string object
142*/
143static 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
157TString *luaS_createlngstrobj (lua_State *L, size_t l) {

Callers 2

luaS_createlngstrobjFunction · 0.85
internshrstrFunction · 0.85

Calls 1

luaC_newobjFunction · 0.85

Tested by

no test coverage detected