MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / createstrobj

Function createstrobj

extlibs/lua/src/lstring.c:155–166  ·  view source on GitHub ↗

** creates a new string object */

Source from the content-addressed store, hash-verified

153** creates a new string object
154*/
155static 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
169TString *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