MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / luaS_newhstr

Function luaS_newhstr

other_src/lua/src/lstring.cpp:91–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89
90
91TString *luaS_newhstr (lua_State *L, lua_Hash h, const char *str, size_t l) {
92 GCObject *o;
93 for (o = G(L)->strt.hash[lmod(h, G(L)->strt.size)];
94 o != NULL;
95 o = o->gch.next) {
96 TString *ts = rawgco2ts(o);
97 if (ts->tsv.len == l && (memcmp(str, getstr(ts), l) == 0)) {
98 /* string may be dead */
99 if (isdead(G(L), o)) changewhite(o);
100 return ts;
101 }
102 }
103 return newlstr(L, str, l, h); /* not found */
104}
105
106
107TString *luaS_newlstr (lua_State *L, const char *str, size_t l) {

Callers 1

lua_pushhstringFunction · 0.85

Calls 1

newlstrFunction · 0.70

Tested by

no test coverage detected