MCPcopy Create free account
hub / github.com/DFHack/dfhack / createstrobj

Function createstrobj

depends/lua/src/lstring.c:133–144  ·  view source on GitHub ↗

** creates a new string object */

Source from the content-addressed store, hash-verified

131** creates a new string object
132*/
133static 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
147TString *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