MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / newshrstr

Function newshrstr

third-party/lua-5.2.4/src/lstring.c:116–127  ·  view source on GitHub ↗

** creates a new short string, inserting it into string table */

Source from the content-addressed store, hash-verified

114** creates a new short string, inserting it into string table
115*/
116static TString *newshrstr (lua_State *L, const char *str, size_t l,
117 unsigned int h) {
118 GCObject **list; /* (pointer to) list where it will be inserted */
119 stringtable *tb = &G(L)->strt;
120 TString *s;
121 if (tb->nuse >= cast(lu_int32, tb->size) && tb->size <= MAX_INT/2)
122 luaS_resize(L, tb->size*2); /* too crowded */
123 list = &tb->hash[lmod(h, tb->size)];
124 s = createstrobj(L, str, l, LUA_TSHRSTR, h, list);
125 tb->nuse++;
126 return s;
127}
128
129
130/*

Callers 1

internshrstrFunction · 0.85

Calls 2

luaS_resizeFunction · 0.70
createstrobjFunction · 0.70

Tested by

no test coverage detected