MCPcopy Create free account
hub / github.com/F-Stack/f-stack / newshrstr

Function newshrstr

freebsd/contrib/openzfs/module/lua/lstring.c:117–128  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

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

Callers 1

internshrstrFunction · 0.85

Calls 2

createstrobjFunction · 0.85
luaS_resizeFunction · 0.70

Tested by

no test coverage detected