** new string (with explicit length) */
| 155 | ** new string (with explicit length) |
| 156 | */ |
| 157 | TString *luaS_newlstr (lua_State *L, const char *str, size_t l) { |
| 158 | if (l <= LUAI_MAXSHORTLEN) /* short string? */ |
| 159 | return internshrstr(L, str, l); |
| 160 | else { |
| 161 | if (l + 1 > (MAX_SIZET - sizeof(TString))/sizeof(char)) |
| 162 | luaM_toobig(L); |
| 163 | return createstrobj(L, str, l, LUA_TLNGSTR, G(L)->seed, NULL); |
| 164 | } |
| 165 | } |
| 166 | |
| 167 | |
| 168 | /* |
no test coverage detected