MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / luaX_newstring

Function luaX_newstring

deps/lua/src/llex.c:117–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

115
116
117TString *luaX_newstring (LexState *ls, const char *str, size_t l) {
118 lua_State *L = ls->L;
119 TString *ts = luaS_newlstr(L, str, l);
120 TValue *o = luaH_setstr(L, ls->fs->h, ts); /* entry for `str' */
121 if (ttisnil(o)) {
122 setbvalue(o, 1); /* make sure `str' will not be collected */
123 luaC_checkGC(L);
124 }
125 return ts;
126}
127
128
129static void inclinenumber (LexState *ls) {

Callers 4

read_long_stringFunction · 0.85
read_stringFunction · 0.85
llexFunction · 0.85
anchor_tokenFunction · 0.85

Calls 2

luaS_newlstrFunction · 0.85
luaH_setstrFunction · 0.85

Tested by

no test coverage detected