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