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