** creates a new short string, inserting it into string table */
| 115 | ** creates a new short string, inserting it into string table |
| 116 | */ |
| 117 | static 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 | /* |
no test coverage detected